Re: Why not working under 8.3

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: Andreas Moeller <a(dot)moeller(at)teia(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why not working under 8.3
Date: 2009-03-04 16:22:03
Message-ID: 1271681374.4753751236183723433.JavaMail.root@sz0030a.emeryville.ca.mail.comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


----- "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.
>
> --

Out of curiosity I went back to 8.0 and ran the function and got:
production=> SELECT dodi();
WARNING: column "?column?" has type "unknown"
DETAIL: Proceeding with relation creation anyway.
CONTEXT: SQL statement "SELECT 'abc' INTO TEMPORARY foonana"
PL/pgSQL function "dodi" line 2 at SQL statement
dodi
------
f
(1 row)

Seems it ignores the unknown type and returns the False value. Type casting has been tightened up in 8.3, so this qualifies as an error now.

Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-03-04 16:46:01 Re: Why not working under 8.3
Previous Message Merlin Moncure 2009-03-04 16:09:58 Re: Why not working under 8.3