Re: PG 7.2b4 bug?

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PG 7.2b4 bug?
Date: 2001-12-17 21:16:40
Message-ID: 3C1E60B8.3040909@pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> Don Baccus <dhogaza(at)pacifier(dot)com> writes:
>
>>Apparently there's been a change in the way views are handled within
>>PostreSQL. The following program works fine in earlier versions.
>>
>
> AFAICT, it was just pure, unadulterated luck that it "works" in prior
> versions.
>
> In 7.1 I get:
>
> regression=# select test_seq.nextval from multiple_rows;
> NOTICE: Adding missing FROM-clause entry for table "test_seq"
> nextval
> ---------
> 3
> 4
> (2 rows)

Normally one expects a statement's sematics to depend only upon the
source code and to be consistent, not to vary depending on the mood du
jour of the processor ... this also fails (it's the same statement with
manual substitution):

test=# select (select nextval('test_seq_x') as nextval) as test_seq from
multiple_rows;
test_seq
----------
2
2
(2 rows)

test=#

In other words the function's only called once (as I expected).

I've looked at Date and Darwin's appendix on SQL3's PSMs but it's no
help that I can see, it doesn't get into nitpicking semantic details
regarding their use in queries, just their definition.

Maybe the behavior's implementation defined ... if not, I'd presume SQL3
states that a function in the above context is called either once per
row or once per query, not sometimes one or sometimes the other.

So I think it's too early to write this off as not being a bug ...

--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2001-12-17 21:25:21 Re: Potential bug in pg_dump ...
Previous Message Tom Lane 2001-12-17 21:13:08 Re: PG 7.2b4 bug?