Re: New.* and old.* as function arguments within rules

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: New.* and old.* as function arguments within rules
Date: 2005-12-04 04:29:43
Message-ID: 5111.1133670583@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Karl O. Pinc" <kop(at)meme(dot)com> writes:
> 2nd, nowhere have I found a NEW.* syntax (as written).

This could certainly stand to be better documented, but there is an
example for instance here:
http://developer.postgresql.org/docs/postgres/xfunc-sql.html#AEN31568

In general, "foo.*" where foo is a visible table alias is meaningful
anywhere that a rowtype value would be accepted. There is a special
case at the top level of a SELECT result list, where it will be broken
apart into a list of foo's component fields because the SQL spec says
so.

At one time you could just write "foo" instead of "foo.*", but that's
deprecated because it's ambiguous against the case of a simple column
"foo". I'm not sure to what extent it still works at all, and it
probably will stop working in any remaining cases someday.

NEW/OLD are not different from other table aliases as far as these
matters go.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-04 04:35:26 Re: [GENERAL] Missing variable "role" in "pg_settings"?
Previous Message Bruce Momjian 2005-12-04 04:22:10 Re: [GENERAL] Missing variable "role" in "pg_settings"?