Re: New.* and old.* as function arguments within rules - Mailing list pgsql-general

From Tom Lane
Subject Re: New.* and old.* as function arguments within rules
Date
Msg-id 5111.1133670583@sss.pgh.pa.us
Whole thread Raw
In response to Re: New.* and old.* as function arguments within rules  ("Karl O. Pinc" <kop@meme.com>)
Responses Re: New.* and old.* as function arguments within rules
List pgsql-general
"Karl O. Pinc" <kop@meme.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

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Missing variable "role" in "pg_settings"?
Next
From: Tom Lane
Date:
Subject: Re: Missing variable "role" in "pg_settings"?