Re: to_typemod(type_name) information function

From: Sophie Herold <sophie_h(at)hemio(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: to_typemod(type_name) information function
Date: 2017-11-18 16:58:16
Message-ID: 4fdfd1ad-ca6f-d85d-c837-58ac10b706c7@hemio.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18/11/17 16:50, Tom Lane wrote:
> Sophie Herold <sophie_h(at)hemio(dot)de> writes:
>> I need to test a (user) given column type name, with one in the database
>> for equality. To this end, I have to do some kind of normalization (e.g.
>> 'timestamptz(2)' to 'timestamp (2) with time zone'.)
>
> Perhaps format_type(oid, integer) would help you.
>
> regards, tom lane
>

I am not sure how. I am exactly looking for the the second argument integer.

The only workaround I can think of is to create a table with a column
with that type, ask the pg_catalog for the typemod afterwards and
rollback the creation. But that doesn't sound like a proper solution to me.

Best,
Sophie

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-11-18 17:05:18 Re: [HACKERS] Consistently catch errors from Python _New() functions
Previous Message Peter Eisentraut 2017-11-18 16:33:07 Re: [HACKERS] Consistently catch errors from Python _New() functions