Skip to content

Commit

Permalink
fix: tighten up allowed types in the binary format
Browse files Browse the repository at this point in the history
  • Loading branch information
pgguru committed Oct 28, 2024
1 parent c6fc1c6 commit 624b001
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pgrx_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,18 @@ pub(crate) fn is_array_type(typoid: Oid) -> bool {

pub(crate) fn is_supported_array_element_type(_array_element_id: Oid) -> bool {
#[cfg(feature = "pg13")]
return u32::from(_array_element_id) < FirstNormalObjectId;
#[cfg(not(feature = "pg13"))]
if u32::from(_array_element_id) >= FirstNormalObjectId {
// we don't support arrays of user-defined composite types in pg 13
return !is_composite_type(_array_element_id);
}

true
}

pub(crate) fn is_supported_composite_type(_composite_id: Oid) -> bool {
#[cfg(feature = "pg13")]
return u32::from(_composite_id) < FirstNormalObjectId;
#[cfg(not(feature = "pg13"))]
if u32::from(_composite_id) >= FirstNormalObjectId {}

true
}

Expand Down

0 comments on commit 624b001

Please sign in to comment.