pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #7846: Documentation: Should FOUND be documented as an output of UPDATE statement?
2+ messages / 2 participants
[nested] [flat]
* BUG #7846: Documentation: Should FOUND be documented as an output of UPDATE statement?
@ 2013-02-02 15:28 mike@fontling.com
2013-02-04 21:05 ` Re: BUG #7846: Documentation: Should FOUND be documented as an output of UPDATE statement? Kevin Grittner <kgrittn@ymail.com>
0 siblings, 1 reply; 2+ messages in thread
From: mike@fontling.com @ 2013-02-02 15:28 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 7846
Logged by: Mike Sherrill
Email address: mike@fontling.com
PostgreSQL version: 9.1.6
Operating system: Ubuntu Linux 12.04
Description:
Documentation for the SQL UPDATE statement doesn't mention that it sets the
FOUND variable. (Refer to sql-update.html, "Outputs".) That behavior *is*
documented, but only in plpgsql-statements.html (Basic Statements, section
39.5.5).
I understand the difference between a SQL statement and a PL/PGSQL
statement. But if I were looking for the effects and side-effects of an
UPDATE statement, I'd go to the docs for UPDATE, not for PL/PGSQL basic
statements. I think that's what most people would do, especially if they
didn't have prior knowledge of the FOUND variable.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #7846: Documentation: Should FOUND be documented as an output of UPDATE statement?
2013-02-02 15:28 BUG #7846: Documentation: Should FOUND be documented as an output of UPDATE statement? mike@fontling.com
@ 2013-02-04 21:05 ` Kevin Grittner <kgrittn@ymail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Grittner @ 2013-02-04 21:05 UTC (permalink / raw)
To: mike@fontling.com <mike@fontling.com>; pgsql-bugs
"mike@fontling.com" <mike@fontling.com> wrote:
> Documentation for the SQL UPDATE statement doesn't mention that
> it sets the FOUND variable. (Refer to sql-update.html,
> "Outputs".) That behavior *is* documented, but only in
> plpgsql-statements.html (Basic Statements, section 39.5.5).
>
> I understand the difference between a SQL statement and a
> PL/PGSQL statement. But if I were looking for the effects and
> side-effects of an UPDATE statement, I'd go to the docs for
> UPDATE, not for PL/PGSQL basic statements. I think that's what
> most people would do, especially if they didn't have prior
> knowledge of the FOUND variable.
Outside of plpgsql there isn't any FOUND variable to set. If we
did what you suggest, I think we'd get bug reports about this:
test=# update t set amt = 2 where id = 1;
UPDATE 1
test=# select found;
ERROR: column "found" does not exist
LINE 1: select found;
^
plpgsql creates a FOUND variable and sets it based on the rows
affected by various statements. Besides that, with all the various
PLs that are supported in PostgreSQL, littering the documention of
each SQL statement with details of how that statement is supported
in each PL would get really messy really quickly.
-Kevin
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2013-02-04 21:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-02-02 15:28 BUG #7846: Documentation: Should FOUND be documented as an output of UPDATE statement? mike@fontling.com
2013-02-04 21:05 ` Kevin Grittner <kgrittn@ymail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox