2
0

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:
Jack Christensen
2023-04-20 20:12:20 -05:00
parent 2cf1541bb9
commit 67f2a41587
2 changed files with 48 additions and 1 deletions
+3 -1
View File
@@ -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,
)