Re: [SQL] Array as parameter in plpgSQL functions

2001-03-01 Thread Christopher Sawtell
On Thu, 01 Feb 2001 09:47, Jie Liang wrote: > e.g. > > create function foo(_int4) returns int2 as' > declare > a _int4 alias for $1; > i int:=1; > begin > while a[i] loop > i:=i+1; > end loop; > return i-1; > end; > ' language 'plpgsql'; > > you can call it by: > > select foo('{1232131,12312321,34

[SQL] BufTableDelete: BufferLookup table corrupted

2001-03-01 Thread Blaise Carrupt
Hi all ! I'm working with PostgreSQL 7.0.2, and I may have a little problem : my database seems to be corrupted. When I connect to database (with psql, e.g.), I receive the message 'FATAL 1: BufTableDelete: BufferLookup table corrupted'. If I insist, I can enter the database. But then, a coup

Re: [SQL] BufTableDelete: BufferLookup table corrupted

2001-03-01 Thread Blaise Carrupt
I restarted Postmaster and it works now ! Thanks. The only thing I can say about it is that I was in the middle of a transaction executed in background, using 100% CPU, and I killed the postmaster forked for my transaction (I work under HP-UX). Maybe I shouldn't do this... :) ___ B. Ca

Re: [SQL] BufTableDelete: BufferLookup table corrupted

2001-03-01 Thread Tom Lane
Blaise Carrupt <[EMAIL PROTECTED]> writes: > When I connect to database (with psql, e.g.), I receive the message > 'FATAL 1: BufTableDelete: BufferLookup table corrupted'. Try restarting the postmaster. AFAICS your problems are just with datastructures in shared memory, so a postmaster restart s

[SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Frank Joerdens
When doing a subselect with NOT IN, as in SELECT name FROM customer WHERE customer_id NOT IN ( SELECT customer_id FROM salesorder ); (from Bruce Momjian's book) I get no rows if the result column returned by the subselect contains NULL values. It works as expected if I remove the NULL values fr

Re: [SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Josh Berkus
Mr. Joerdens, > I get no rows if the result column returned by the subselect > contains NULL values. It works as expected if I remove the NULL values > from the result set. Is this behaviour correct and if so, why? I can see how that bug would happen. You may want to forward your e-mail to pgsq

Re: [SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Bruce Momjian
> When doing a subselect with NOT IN, as in > > SELECT name > FROM customer > WHERE customer_id NOT IN ( > SELECT customer_id > FROM salesorder > ); > > (from Bruce Momjian's book) > > I get no rows if the result column returned by the subselect > contains NULL values. It works as expected if I

Re: [SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Peter Eisentraut
Frank Joerdens writes: > When doing a subselect with NOT IN, as in > > SELECT name > >FROM customer > WHERE customer_id NOT IN ( > SELECT customer_id > >FROM salesorder > ); > > (from Bruce Momjian's book) > > I get no rows if the result column returned by the subselect > contains NULL values. It

Re: [SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Stephan Szabo
On Thu, 1 Mar 2001, Frank Joerdens wrote: > When doing a subselect with NOT IN, as in > > SELECT name > FROM customer > WHERE customer_id NOT IN ( > SELECT customer_id > FROM salesorder > ); > > (from Bruce Momjian's book) > > I get no rows if the result column returned by the subselect > con

Re: [SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Ken Kline
this is kind of weird but it is how it works. You cannot use equality for null... Null does not equal Null Null means no value, since it's not a value it can't equal anything another no value. SELECT name FROM customer WHERE customer_id NOT IN ( SELECT customer_id FROM salesorder ) and customer_i

Re: [SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Tom Lane
Frank Joerdens <[EMAIL PROTECTED]> writes: > When doing a subselect with NOT IN, as in > SELECT name > FROM customer > WHERE customer_id NOT IN ( > SELECT customer_id > FROM salesorder > ); > I get no rows if the result column returned by the subselect > contains NULL values. It works as expected

Re: [SQL] Weird NOT IN effect with NULL values

2001-03-01 Thread Bruce Momjian
> SELECT name > FROM customer > WHERE NOT EXISTS ( > SELECT customer_id > FROM salesorder > WHERE customer_id = customer.customer_id > ); > > Bruce, you may want to consider editing your next edition to include the > above modification. WHERE ... NOT IN is a bad idea for any subselect on > mediu