-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql/pg_catalog: Fix padding on pg_catalog dropped column attname #120855
Description
Describe the problem
There is a discrepancy between PG and CRDB in the attname atrribute for dropped columns. In the CRDB implementation now we use %8d to create the padding but that results in 1 . too few as PG always has 8. https://github.com/postgres/postgres/blob/57184c3b5d89763c882a15adfcdb00990a09d382/src/backend/catalog/heap.c#L1708
To Reproduce
Set up a PG and CRDB instance and create the same table definition. Drop a column and query pg_attributes for the dropped column attname.
SELECT attname, atttypid, attnotnull, collname FROM pg_attribute LEFT OUTER JOIN pg_collation ON (pg_collation.oid = pg_attribute.attcollation) WHERE attrelid = <table_oid> AND attnum > 0 ORDER BY attnum;
Expected behavior
Both the PG and CRDB query should return the same attname.
Jira issue: CRDB-36904