sql/pg_catalog: Fix padding on pg_catalog dropped column attname #120855
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
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#L1708To 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
The text was updated successfully, but these errors were encountered: