Unix Technical Forum

BUG #2096: bug in a SPI sample document

This is a discussion on BUG #2096: bug in a SPI sample document within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2096 Logged by: Yoshihisa Nakano Email address: nakano.yosihisa@jp.fujitsu.com PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:33 AM
Yoshihisa Nakano
 
Posts: n/a
Default BUG #2096: bug in a SPI sample document


The following bug has been logged online:

Bug reference: 2096
Logged by: Yoshihisa Nakano
Email address: nakano.yosihisa@jp.fujitsu.com
PostgreSQL version: 8.1.0
Operating system: RedHat Enterprise Linux ES 3.0
Description: bug in a SPI sample document
Details:

There is a difference between the result of the SPI
example in the doc and the actual result of that.


Doc 40.5 Examples
=> SELECT * FROM a;
x
---
1 -- no rows in a (0) + 1
(1 row)

=> INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1);
INFO: EXECQ: 0
INSERT 167713 1


I tried this example, but INFO showed 1, not 0. I
think the value of INFO in doc is wrong, because the
value of row is 1 at this time.

This bug seems to exist also in 7.3.x, 7.4.x and 8.0.x.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:33 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2096: bug in a SPI sample document

"Yoshihisa Nakano" <nakano.yosihisa@jp.fujitsu.com> writes:
> => INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1);
> INFO: EXECQ: 0
> INSERT 167713 1


> I tried this example, but INFO showed 1, not 0.


Yeah ... the INSERT won't show an OID by default anymore, either.
Fixed; thanks for the report!

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:48 AM
Bruce Momjian
 
Posts: n/a
Default Re: BUG #2096: bug in a SPI sample document


This documentation bug has been fixed. We currently have:

=> SELECT * FROM a;
x
---
1 -- no rows in a (0) + 1
(1 row)

=> INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1);
INFO: EXECQ: 1
INSERT 0 1

Is the "INSERT 0 1" right? I see an oid in your example, but that might
be because we no longer user oids by default.

---------------------------------------------------------------------------

Yoshihisa Nakano wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2096
> Logged by: Yoshihisa Nakano
> Email address: nakano.yosihisa@jp.fujitsu.com
> PostgreSQL version: 8.1.0
> Operating system: RedHat Enterprise Linux ES 3.0
> Description: bug in a SPI sample document
> Details:
>
> There is a difference between the result of the SPI
> example in the doc and the actual result of that.
>
>
> Doc 40.5 Examples
> => SELECT * FROM a;
> x
> ---
> 1 -- no rows in a (0) + 1
> (1 row)
>
> => INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1);
> INFO: EXECQ: 0
> INSERT 167713 1
>
>
> I tried this example, but INFO showed 1, not 0. I
> think the value of INFO in doc is wrong, because the
> value of row is 1 at this time.
>
> This bug seems to exist also in 7.3.x, 7.4.x and 8.0.x.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>


--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 09:48 AM
NAKANO Yoshihisa
 
Posts: n/a
Default Re: BUG #2096: bug in a SPI sample document

Bruce Momjian wrote:
> This documentation bug has been fixed. We currently have:
>
> => SELECT * FROM a;
> x
> ---
> 1 -- no rows in a (0) + 1
> (1 row)
>
> => INSERT INTO a VALUES (execq('SELECT * FROM a', 0) + 1);
> INFO: EXECQ: 1
> INSERT 0 1
>
> Is the "INSERT 0 1" right? I see an oid in your example, but that might
> be because we no longer user oids by default.


Yes. IIRC, Tom had already pointed out that and fixed.

http://archives.postgresql.org/pgsql...2/msg00071.php

Regards,
Yoshihisa Nakano


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:33 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com