Message-ID: From: "df7cb (@df7cb)" To: "postgresql-interfaces/psqlodbc" Date: Fri, 04 Oct 2024 14:57:29 +0000 Subject: Re: [postgresql-interfaces/psqlodbc] issue #51: SQL_DESC_OCTET_LENGTH regression test difference In-Reply-To: References: List-Id: X-GitHub-Author-Login: df7cb X-GitHub-Comment-Id: 2393903668 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 51 X-GitHub-Repo: postgresql-interfaces/psqlodbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/postgresql-interfaces/psqlodbc/issues/51#issuecomment-2393903668 Content-Type: text/plain; charset=utf-8 Running that against 16 and 17 gives the same results (modulo different pg_temp_NN nspname and table oid). ``` CREATE TEMPORARY TABLE desctable (col1 int4 not null, col2 numeric(4,2), col3 varchar(10) not null, col4 bigint not null); select n.nspname, c.relname, a.attname, a.atttypid, t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull, c.relhasrules, c.relkind, c.oid, pg_get_expr(d.adbin, d.adrelid), case t.typtype when 'd' then t.typbasetype else 0 end, t.typtypmod, 0, attidentity, c.relhassubclass from (((pg_catalog.pg_class c inner join pg_catalog.pg_namespace n on n.oid = c.relnamespace and c.oid = 'desctable'::regclass) inner join pg_catalog.pg_attribute a on (not a.attisdropped) and a.attnum > 0 and a.attrelid = c.oid) inner join pg_catalog.pg_type t on t.oid = a.atttypid) left outer join pg_attrdef d on a.atthasdef and d.adrelid = a.attrelid and d.adnum = a.attnum order by n.nspname, c.relname, attnum; nspname │ relname │ attname │ atttypid │ typname │ attnum │ attlen │ atttypmod │ attnotnull │ relhasrules │ relkind │ oid │ pg_get_expr │ case │ typtypmod │ ?column? │ attidentity │ relhassubclass ────────────┼───────────┼─────────┼──────────┼─────────┼────────┼────────┼───────────┼────────────┼─────────────┼─────────┼───────┼─────────────┼──────┼───────────┼──────────┼─────────────┼──────────────── pg_temp_50 │ desctable │ col1 │ 23 │ int4 │ 1 │ 4 │ -1 │ t │ f │ r │ 64095 │ ∅ │ 0 │ -1 │ 0 │ │ f pg_temp_50 │ desctable │ col2 │ 1700 │ numeric │ 2 │ -1 │ 262150 │ f │ f │ r │ 64095 │ ∅ │ 0 │ -1 │ 0 │ │ f pg_temp_50 │ desctable │ col3 │ 1043 │ varchar │ 3 │ -1 │ 14 │ t │ f │ r │ 64095 │ ∅ │ 0 │ -1 │ 0 │ │ f pg_temp_50 │ desctable │ col4 │ 20 │ int8 │ 4 │ 8 │ -1 │ t │ f │ r │ 64095 │ ∅ │ 0 │ -1 │ 0 │ │ f (4 Zeilen) ``` There are already two expected output files in test/expected/descrec.out and test/expected/descrec_1.out with this difference: ``` --- test/expected/descrec_1.out 2024-10-04 16:48:37.623757902 +0200 +++ test/expected/descrec.out 2024-10-04 16:48:37.623757902 +0200 @@ -19,7 +19,7 @@ -- Column 3 -- SQL_DESC_NAME: col3 SQL_DESC_TYPE: 12 -SQL_DESC_OCTET_LENGTH: 20 +SQL_DESC_OCTET_LENGTH: 40 SQL_DESC_PRECISION: 0 SQL_DESC_SCALE: 0 SQL_DESC_NULLABLE: 0 ``` I haven't yet figured out what that length means, but perhaps "10" is another valid output besides 20 and 40? (I hate pg_regress for making it hard to put comments on _1.out alternate output files.)