Fix scanning a table type into a struct
Table types have system / hidden columns like tableoid, cmax, xmax, etc. These are not included when sending or receiving composite types. https://github.com/jackc/pgx/issues/1576
This commit is contained in:
@@ -1282,7 +1282,9 @@ func (c *Conn) getCompositeFields(ctx context.Context, oid uint32) ([]pgtype.Com
|
||||
var fieldOID uint32
|
||||
rows, _ := c.Query(ctx, `select attname, atttypid
|
||||
from pg_attribute
|
||||
where attrelid=$1 and not attisdropped
|
||||
where attrelid=$1
|
||||
and not attisdropped
|
||||
and attnum > 0
|
||||
order by attnum`,
|
||||
typrelid,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user