Re: Re: Inserts in triggers Follow Up - Mailing list pgsql-sql

From Tom Lane
Subject Re: Re: Inserts in triggers Follow Up
Date
Msg-id 21390.996075786@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: Inserts in triggers Follow Up  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
"Josh Berkus" <josh@agliodbs.com> writes:
> That's because the SELECT INTO variable and SELECT INTO record syntax
> are confusingly different.  It's

> for records:
> SELECT INTO record_var * FROM ...

> for simple variables:
> SELECT column INTO variable FROM ...

> I'm not clear on the origin of the inconsistency; my guess is that jan
> copied it over from PL/SQL.

No, this isn't right.  If you check the source code you will discover
that plpgsql is extremely lax about the positioning of the INTO clause,
and will in fact accept it almost anywhere.  Datatype has nothing to
do with this.  (It probably should be stricter, but at this point I
doubt we could change it without drawing howls of anguish from those
who did it the other way.)

I'm not sure about Morgan's problem, but I suspect it isn't in the
part of the query that he showed us.  An unexpected substitution
in the WHERE clause seems like a plausible theory.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Re: Inserts in triggers Follow Up
Next
From: Stephan Szabo
Date:
Subject: Re: Meta integrity