Lists: | pgsql-hackers |
---|
From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Warning for undefined cursor |
Date: | 2003-07-28 09:10:39 |
Message-ID: | Pine.LNX.4.56.0307281106590.2256@krusty.credativ.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
In backend/commands/portalcmds.c we have
/* FIXME: shouldn't this be an ERROR? */
ereport(WARNING,
(errcode(ERRCODE_UNDEFINED_CURSOR),
errmsg("portal \"%s\" does not exist", stmt->portalname)));
The effect of this is that you can fetch from an undefined cursor and
(successfully) get zero rows plus this warning. I propose that we change
this to an error. Does anyone see a reason against this, except possibly
bugward compatibility?
--
Peter Eisentraut peter_e(at)gmx(dot)net
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Warning for undefined cursor |
Date: | 2003-07-28 13:48:15 |
Message-ID: | 8837.1059400095@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> In backend/commands/portalcmds.c we have
> /* FIXME: shouldn't this be an ERROR? */
> The effect of this is that you can fetch from an undefined cursor and
> (successfully) get zero rows plus this warning. I propose that we change
> this to an error. Does anyone see a reason against this, except possibly
> bugward compatibility?
Backwards compatibility is the reason why it isn't an error now.
-hackers is not really the right forum to find out whether anyone is
depending on that behavior. I'd suggest you shop the proposal around
on -general or -sql and see if you get any complaints. (I think there
are a couple other cursor-related warnings that really oughta be errors,
too; might as well finger them all while you are at it.)
regards, tom lane
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Warning for undefined cursor |
Date: | 2003-07-30 21:59:58 |
Message-ID: | 200307302159.h6ULxwq14354@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Peter, you have brought up some good items recently. Are you going to
handle them or do you want them added to the TODO list or 7.4 open items
list.
---------------------------------------------------------------------------
Peter Eisentraut wrote:
> In backend/commands/portalcmds.c we have
>
> /* FIXME: shouldn't this be an ERROR? */
> ereport(WARNING,
> (errcode(ERRCODE_UNDEFINED_CURSOR),
> errmsg("portal \"%s\" does not exist", stmt->portalname)));
>
> The effect of this is that you can fetch from an undefined cursor and
> (successfully) get zero rows plus this warning. I propose that we change
> this to an error. Does anyone see a reason against this, except possibly
> bugward compatibility?
>
> --
> Peter Eisentraut peter_e(at)gmx(dot)net
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073