Re: Add CREATE support to event triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add CREATE support to event triggers
Date: 2014-02-05 19:56:28
Message-ID: 30665.1391630188@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Robert Haas escribi:
>> How about doing whatever pg_dump does?

> We use format_type() for that as far as I know. What it does
> differently is use undecorated names defined by the standard for some
> types, which are never schema qualified and are never ambiguous because
> they are reserved words that would require quoting if used by
> user-defined type names. We can't use that here: somewhere upthread we
> noticed issues when using those which is why we're now trying to use
> catalog names instead of those special names. (I don't think it's
> impossible to use such names: we just need to ensure we handle quoting
> correctly for the funny cases such as "char" and "bit.)

Yeah, but wouldn't that complexity also bubble into user code within the
event triggers? Since there's no real need for SQL standard compliance
in this context, I think minimizing the number of weird formats is a
win.

> One idea is to chop the typmod output string at the closing parens.

+1. The only reason timestamptypmodout works like that is that we're
trying to match the SQL standard's spelling of the type names, and
that committee apparently considers it an off day whenever they can't
invent some randomly-incompatible-with-everything syntax.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2014-02-05 20:15:14 Re: jsonb and nested hstore
Previous Message Joshua D. Drake 2014-02-05 19:46:53 Re: narwhal and PGDLLIMPORT