The developers are currently discussing changing several cursor-related
warnings to hard errors.  If PostgreSQL were to be designed from scratch,
there would hardly be discussion about this, but now we are wondering
whether any existing users would seriously be affected by this change.
The cases under consideration are:

Fetching from a non-existent cursor:

peter=# FETCH ALL FROM non_existent;
WARNING:  portal "non_existent" does not exist
FETCH 0

Closing a non-existent cursor:

peter=# CLOSE non_existent;
WARNING:  portal "non_existent" does not exist
CLOSE CURSOR

Declaring a new cursor that uses a name already in use:

peter=# BEGIN;
BEGIN
peter=# DECLARE foo CURSOR FOR SELECT 1;
DECLARE CURSOR
peter=# DECLARE foo CURSOR FOR SELECT 2;
WARNING:  Closing pre-existing portal "foo"
DECLARE CURSOR

So if anyone can come up with a reason that theses WARNING: messages
should not be changed to errors, please speak up.

-- 
Peter Eisentraut   peter_e@gmx.net

Wed, 30 Jul 2003 11:06:39 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Which cursor-related warnings should be errors?
Hi all,

I suppose this must be easy to figure out, but I can't find it anywhere in 
the documentation.

How do I call a function that takes a rowtype for an argument as in:

CREATE FUNCTION myfunc(mytablename) RETURNS INT AS '
BEGIN
	-- Do stuff
	RETURN val;
END;
' LANGUAGE 'plpgsql'

How do I call this function? I haven't been able to figure it out or find 
it anywhere...

Thanks in advance,


Martin


Wed, 06 Aug 2003 11:23:40 +0200
Martin Brommer <martin@brommer.nl>
Using rowtype as function argument
Martin Brommer <martin@brommer.nl> writes:
> How do I call a function that takes a rowtype for an argument as in:
> CREATE FUNCTION myfunc(mytablename) RETURNS INT AS '

SELECT myfunc(mytablename.*) FROM mytablename;

This also works at the moment, but seems less clear to me:

SELECT myfunc(mytablename) FROM mytablename;

			regards, tom lane

Wed, 06 Aug 2003 10:40:37 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Using rowtype as function argument 
Since no one responded to the message below (posted on pgsql-sql), I made
the change from warning to error in the indicated cases.


> Fetching from a non-existent cursor:
>
> peter=# FETCH ALL FROM non_existent;
> WARNING:  portal "non_existent" does not exist
> FETCH 0
>
> Closing a non-existent cursor:
>
> peter=# CLOSE non_existent;
> WARNING:  portal "non_existent" does not exist
> CLOSE CURSOR
>
> Declaring a new cursor that uses a name already in use:
>
> peter=# BEGIN;
> BEGIN
> peter=# DECLARE foo CURSOR FOR SELECT 1;
> DECLARE CURSOR
> peter=# DECLARE foo CURSOR FOR SELECT 2;
> WARNING:  Closing pre-existing portal "foo"
> DECLARE CURSOR
>
> So if anyone can come up with a reason that theses WARNING: messages
> should not be changed to errors, please speak up.

-- 
Peter Eisentraut   peter_e@gmx.net


Sun, 24 Aug 2003 23:10:24 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Which cursor-related warnings should be errors?