Re: to_typemod(type_name) information function

2018-03-01 Thread Sophie Herold
Hi, On 01/03/18 11:16, Andres Freund wrote: > Sophie, are you planning to > implement something along these lines? I don't have time right now, but yes. Best, Sophie

to_typemod(type_name) information function

2017-11-18 Thread Sophie Herold
Hi, 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'.) Comparing the name alone is possible with to_regtype(type_name) or ::regtype. However, this ig

Re: to_typemod(type_name) information function

2017-11-18 Thread Sophie Herold
On 18/11/17 16:50, Tom Lane wrote: > Sophie Herold 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

Re: to_typemod(type_name) information function

2017-11-21 Thread Sophie Herold
Hi, the following patch allows to retrieve the typemod. Without this patch, it does not seem to be possible to generate the first column. SELECT format_type(to_regtype(t), pg_to_typemod(t)), format_type(to_regtype(t), NULL) FROM (VALUES ('INTERVAL SECOND (5)'), ('Varchar(17)'