Skip site navigation (1) Skip section navigation (2)

Re: BUG #5105: "Select Into Strict" does not throw NO_DATA_FOUND

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Walter Mesz" <meszwalter(at)yahoo(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5105: "Select Into Strict" does not throw NO_DATA_FOUND
Date: 2009-10-08 15:22:42
Message-ID: 24297.1255015362@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Walter Mesz" <meszwalter(at)yahoo(dot)de> writes:
> my problem is that this select into does not throw a NO_DATA_FOUND if my
> select involves a max().

Well, a query using max() (or any other aggregate) is defined to return
exactly one row, independently of how many rows feed into the max().
So I'm not sure why you'd think that it should throw NO_DATA_FOUND.

If you want to test for not finding any rows in the underlying scan,
the best way would be to also compute count(*) and check if that's
zero.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Kevin GrittnerDate: 2009-10-08 15:28:51
Subject: Re: BUG #5105: "Select Into Strict" does not throw NO_DATA_FOUND
Previous:From: Tom LaneDate: 2009-10-08 15:19:28
Subject: Re: BUG #5102: Silent IN (list of strings) failure to detect syntax error when list is linewrapped

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group