Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread mike
You are right as usual My apologies yet again. I have wrongly assumed that the lower statement would run first since it is enclosed in parenthesis. On Tue, 2006-12-19 at 00:48 -0500, Tom Lane wrote: > mike <[EMAIL PROTECTED]> writes: > > Pgsql does not throw an error (at least prior to 8.2)

Re: [BUGS] BUG #2838: Compile error "tab-complete.c" on Mac OS X

2006-12-18 Thread Tom Lane
"Thomas Jahnsen" <[EMAIL PROTECTED]> writes: > I try to compile PostgreSQL 8.2, but it fails in the file "tab-complete.c" > (src/bin/psql/tab-complete.c). It reports an undeclared function call; > 'rl_filename_completion_function' Please be specific about the version of libreadline (or Apple's lib

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Tom Lane
mike <[EMAIL PROTECTED]> writes: > Pgsql does not throw an error (at least prior to 8.2) if the column > referenced by the select statement for the IN clause does not exist. My, there's a lot of misinformation in this thread. The reason there's no error thrown is that the reference to mov_id in t

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread mike
Also check that the mov_id column exists in the table/view that you are running the SELECT DISTINCT against. Pgsql does not throw an error (at least prior to 8.2) if the column referenced by the select statement for the IN clause does not exist. It will run only SELECT * FROM movies.names in this

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Tom Lane
"Thomas H." <[EMAIL PROTECTED]> writes: > SELECT * FROM movies.names WHERE mov_id IN (SELECT DISTINCT mov_id WHERE > mov_name like '%, %' LIMIT 2) > the subselect is missing a FROM . in that case, pgsql seemed to also > ignore the LIMIT 2 It didn't "ignore" anything. Each execution of the sub-

Re: [BUGS] BUG #2837: i received ERROR: failed to build any 7-way joins

2006-12-18 Thread Tom Lane
"canli" <[EMAIL PROTECTED]> writes: > i received an error: failed to build any 7-way joins I think this is the same problem already reported here: http://archives.postgresql.org/pgsql-bugs/2006-12/msg00092.php and patched here: http://archives.postgresql.org/pgsql-committers/2006-12/msg00102.php

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Thomas H.
>> SELECT * FROM movies.names WHERE mov_id IN (SELECT DISTINCT mov_id >> WHERE >> mov_name like '%, %' LIMIT 2) IF the subquery would only have returned 2 ids, then there would be at most like +/-10 records affected. each mov_id can hold one or more (usuals up to 5) names. but here, the subqu

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Jaime Casanova
On 12/18/06, Thomas H. <[EMAIL PROTECTED]> wrote: >> oups. just thumbled over this as well when i forgot a FROM in a WHERE ... >> IN >> () and damaged quite some data. the bad query went like this: >> >> SELECT * FROM movies.names WHERE mov_id IN (SELECT DISTINCT mov_id WHERE >> mov_name like

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Thomas H.
oups. just thumbled over this as well when i forgot a FROM in a WHERE ... IN () and damaged quite some data. the bad query went like this: SELECT * FROM movies.names WHERE mov_id IN (SELECT DISTINCT mov_id WHERE mov_name like '%, %' LIMIT 2) the subselect is missing a FROM . in that case, p

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Jaime Casanova
On 12/18/06, Thomas H. <[EMAIL PROTECTED]> wrote: >> > Is it a bug? If no, maybe to produce warning in such cases? oups. just thumbled over this as well when i forgot a FROM in a WHERE ... IN () and damaged quite some data. the bad query went like this: SELECT * FROM movies.names WHERE mov_

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Thomas H.
> Is it a bug? If no, maybe to produce warning in such cases? oups. just thumbled over this as well when i forgot a FROM in a WHERE ... IN () and damaged quite some data. the bad query went like this: SELECT * FROM movies.names WHERE mov_id IN (SELECT DISTINCT mov_id WHERE mov_name like

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Jaime Casanova
On 12/19/06, Nikolay Samokhvalov <[EMAIL PROTECTED]> wrote: > Following query is considered as correct, no "missing from" error has > been reported (so, entire table will be updated and "on update" > triggers will be fired for every row): > > update item set obj_id = obj_id > where obj_id in (sele

Re: [BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Nikolay Samokhvalov
ok, sorry, I've realized that it's yet another example of "outer reference", Tom will say "read any SQL book" again :-) http://archives.postgresql.org/pgsql-bugs/2006-12/msg00115.php On 12/19/06, Nikolay Samokhvalov <[EMAIL PROTECTED]> wrote: Following query is considered as correct, no "missin

[BUGS] No error when FROM is missing in subquery

2006-12-18 Thread Nikolay Samokhvalov
Following query is considered as correct, no "missing from" error has been reported (so, entire table will be updated and "on update" triggers will be fired for every row): update item set obj_id = obj_id where obj_id in (select obj_id where item_point is null order by obj_modified limit 10) Is

[BUGS] BUG #2838: Compile error "tab-complete.c" on Mac OS X

2006-12-18 Thread Thomas Jahnsen
The following bug has been logged online: Bug reference: 2838 Logged by: Thomas Jahnsen Email address: [EMAIL PROTECTED] PostgreSQL version: 8.2 Operating system: Mac OS X 10.4.8 PPC Description:Compile error "tab-complete.c" on Mac OS X Details: I try to compile Po

[BUGS] BUG #2837: i received ERROR: failed to build any 7-way joins

2006-12-18 Thread canli
The following bug has been logged online: Bug reference: 2837 Logged by: canli Email address: [EMAIL PROTECTED] PostgreSQL version: 8.2.0 Operating system: Linux ES 4 Description:i received ERROR: failed to build any 7-way joins Details: When I execute a query: SE

[BUGS] BUG #2836: SPI_execute_plan failed on pl/pgsql function that worked on 8.1

2006-12-18 Thread Albert Cervera i Areny
The following bug has been logged online: Bug reference: 2836 Logged by: Albert Cervera i Areny Email address: [EMAIL PROTECTED] PostgreSQL version: 8.2 Operating system: Debian GNU/Linux Description:SPI_execute_plan failed on pl/pgsql function that worked on 8.1 Deta

[BUGS] BUG #2835: Table inheritance and statement level trigger.

2006-12-18 Thread William ZHANG
The following bug has been logged online: Bug reference: 2835 Logged by: William ZHANG Email address: [EMAIL PROTECTED] PostgreSQL version: 8.2.0 Operating system: Linux Description:Table inheritance and statement level trigger. Details: create language plpgsql; cr

Re: [BUGS] BUG #2830: Wrong results for prepared statements

2006-12-18 Thread Kevin Grittner
>>> On Sat, Dec 16, 2006 at 5:15 PM, in message <[EMAIL PROTECTED]>, Tom Lane <[EMAIL PROTECTED]> wrote: > "" <[EMAIL PROTECTED]> writes: >> Prepared SELECT/UPDATE/DELETE statements produce wrong results if executed >> while target table is being clustered. > > The short answer is "don't CLUSTER