Re: plpgsql

From: dim <dim45(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: plpgsql
Date: 2005-02-12 10:01:27
Message-ID: 420DD3F7.6030000@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


>>Am I missing anything or is
>>record assignment not possible in plpgsql?
>
>
> Your example works fine for me in PG 8.0. There were some improvements
> in this area since 7.*, though I'm not sure offhand whether they were
> material to this particular case.
strange.
laik is the table with rows nr integer and txt varchar.

CREATE OR REPLACE FUNCTION tst1(integer) RETURNS laik AS '
SELECT * FROM laik where nr=$1;
' LANGUAGE 'sql';

CREATE OR REPLACE FUNCTION tst2(integer) RETURNS varchar AS '
DECLARE
v laik;
BEGIN
v := tst1($1);
RETURN 1;
END;
' LANGUAGE 'plpgsql' VOLATILE;

if i try to 'select tst2(1);'
I get the following error message:
ERROR: syntax error at or near "v"
CONTEXT: compile of PL/pgSQL function "tst2" near line 4

I'm using Postgresql 7.4.3. Will try this with 8, but even if it works
with 8, it's not good - I don't know on what version of postgre my db
will later reside.

Thanks,
dim

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Elinor 2005-02-13 15:41:18 Re: find close (duplicate) points + create index
Previous Message Tom Lane 2005-02-12 09:12:56 Re: plpgsql