Skip site navigation (1) Skip section navigation (2)

pl/pgsql breakage in 8.1b4?

From: Philip Yarra <philip(at)utiba(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pl/pgsql breakage in 8.1b4?
Date: 2005-10-28 02:32:15
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Just testing pl/pgsql functions in 8.1beta4, I see failures for syntax that 
works in 8.0.3. The simplest test case for this is:

create table ptest(foo int, bar varchar(10));
create or replace function modify_ptest(
	foo int,
	bar varchar)
returns numeric as $$
	res numeric;
	update ptest
	set bar =
	where foo =;
	res := 0;
return res;
$$ LANGUAGE plpgsql;

The error message from psql is:

ERROR:  syntax error at or near "$1" at character 19
QUERY:  update ptest set  $1  = where  $2  =
CONTEXT:  SQL statement in PL/PgSQL function "modify_ptest" near line 7
LINE 1: update ptest set  $1  = where  $2  = modify...

I assume what I'm trying should still work, though I couldn't find comparable 
examples in the doco. Looks to me like a problem with parameter aliasing.

Regards, Philip.

Utiba Pty Ltd 
This message has been scanned for viruses and
dangerous content by Utiba mail server and is 
believed to be clean.


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2005-10-28 02:34:57
Subject: Re: enums
Previous:From: Mark KirkwoodDate: 2005-10-28 02:28:01
Subject: Re: TODO Item - Add system view to show free space map

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group