Re: Triggers on columns

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Triggers on columns
Date: 2009-10-02 19:04:28
Message-ID: 1254510268.27017.2.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2009-10-01 at 10:40 +0900, Itagaki Takahiro wrote:
> > Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > > If you want a "pretty" option on pg_get_triggerdef(), you could nowadays
> > > also implement that via a parameter default value instead of a second
> > > function.
> >
> > OK, I'll rewrite it to use default parameter.
>
> I tried to remove pg_get_triggerdef_ext() and add a second argument
> with default value to pg_get_triggerdef(), but there is a problem.
>
> The definition of pg_get_triggerdef will be the following:
> DATA(insert OID = 1662 (
> pg_get_triggerdef PGNSP PGUID 12 1 0 0 f f f t f s 2 1 25 "26 16" _null_ _null_ _null_
> "({CONST :consttype 16 :consttypmod -1 :constlen 1 :constbyval true :constisnull false :location 41 :constvalue 1 [ 0 0 0 0 0 0 0 0 ]})"
> pg_get_triggerdef _null_ _null_ _null_ ));
>
> The problem is in :constvalue part; It will be
> ":constvalue 1 [ 0 0 0 0 0 0 0 0 ]" on 64bit platform, but
> ":constvalue 1 [ 0 0 0 0 ]" on 32bit platform.
> I think we should not use default values in functions listed on pg_proc.h,
> so the previous patch is better than default value version.

OK, but what you can do is point both variants to the same C function
and check with PG_NARGS() with how many arguments you were called. That
would save some of the indirections.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message decibel 2009-10-02 19:59:19 Re: FSM search modes
Previous Message Bruce Momjian 2009-10-02 18:44:54 Re: latest hstore patch