From: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
---|---|
To: | Adrian Klaver <aklaver(at)comcast(dot)net> |
Cc: | Andreas Moeller <a(dot)moeller(at)teia(dot)de>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Why not working under 8.3 |
Date: | 2009-03-04 16:09:58 |
Message-ID: | b42b73150903040809x444988afo4d796609eb1102b7@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Mar 4, 2009 at 11:05 AM, Adrian Klaver <aklaver(at)comcast(dot)net> wrote:
>
> ----- "Andreas Moeller" <a(dot)moeller(at)teia(dot)de> wrote:
>
>> Following lines produce an error message under 8.3. - but not under
>> 8.1.
>> Why?
>>
>> CREATE OR REPLACE FUNCTION dodi() RETURNS boolean AS
>> $$
>> BEGIN
>> SELECT 'abc' INTO TEMPORARY foonana;
>> RETURN FALSE;
>> END;
>> $$
>> LANGUAGE 'plpgsql';
>>
>>
>> FEHLER: syntax error at "TEMPORARY"
>> DETAIL: Expected record variable, row variable, or list of scalar
>> variables following INTO.
>> CONTEXT: compile of PL/pgSQL function "dodi" near line 2
>>
>> ********** Fehler **********
>>
>> FEHLER: syntax error at "TEMPORARY"
>> SQL Status:42601
>> Detail:Expected record variable, row variable, or list of scalar
>> variables following INTO.
>> Kontext:compile of PL/pgSQL function "dodi" near line 2
>
> Are you sure this worked in 8.1? SELECT INTO in plpgsql needs to point to a variable as noted by the error message. You need to declare a variable.
looks like ambiguity between plpgsql 'select into' and the regular sql
'select into' method which works like 'create table as'. I vaguely
remember something about this changing. In any event. the OP is crazy
to write it like that, 'create [temp] table as' is preferred.
merlin
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2009-03-04 16:22:03 | Re: Why not working under 8.3 |
Previous Message | Adrian Klaver | 2009-03-04 16:05:56 | Re: Why not working under 8.3 |