ERROR: invalid INTERVAL typmod: 0xc

Started by Darcy Buskermolenabout 22 years ago2 messagesbugs
Jump to latest
#1Darcy Buskermolen
darcy@wavefire.com

The following query works in 7.3 but errors in 7.4.x as well as devel with
the above error

SELECT quote_ident(nspname) as namespace, format_type(pg_type.oid, typlen) as
type_name FROM pg_catalog.pg_type JOIN pg_catalog.pg_namespace ON
(pg_namespace.oid = typnamespace) WHERE pg_type.oid = '1186';

1186 ( the interval type) is the only row that this does not work for.

--
Darcy Buskermolen
Wavefire Technologies Corp.
ph: 250.717.0200
fx: 250.763.1759
http://www.wavefire.com

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Darcy Buskermolen (#1)
Re: ERROR: invalid INTERVAL typmod: 0xc

Darcy Buskermolen <darcy@wavefire.com> writes:

The following query works in 7.3 but errors in 7.4.x as well as devel with
the above error

SELECT quote_ident(nspname) as namespace, format_type(pg_type.oid, typlen) as
type_name FROM pg_catalog.pg_type JOIN pg_catalog.pg_namespace ON
(pg_namespace.oid = typnamespace) WHERE pg_type.oid = '1186';

It's mere chance if it worked in 7.3. The second argument of
format_type is supposed to be atttypmod, not typlen. In this case
it seems you don't have any particular typmod available, so pass
NULL (or -1).

regards, tom lane