Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6PFhJf50390 for ; Wed, 25 Jul 2001 11:43:19 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f6PFh6C21393; Wed, 25 Jul 2001 11:43:06 -0400 (EDT) To: "Josh Berkus" cc: Morgan Curley , pgsql-sql@postgresql.org Subject: Re: Re: Inserts in triggers Follow Up In-reply-to: References: Comments: In-reply-to "Josh Berkus" message dated "Wed, 25 Jul 2001 08:14:09 -0700" Date: Wed, 25 Jul 2001 11:43:06 -0400 Message-ID: <21390.996075786@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200107/343 X-Sequence-Number: 4157 "Josh Berkus" 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