> 
> Bruce,
> 
> On 1998-03-28 10:15:48 -0500, Bruce Momjian wrote:
> > > SELECT DISTINCT * from x2 UNION SELECT * FROM x2;
> > 
> > Sorry to disappoint you, but this is fixed in the 6.3.1 patch.
> 
> No disappointment at all, but I upgraded from 6.3 to 6.3.1.  Well, at least
> I think I did.  Do you know of a way to get the current version of the
> program?

Now I am diappointed.  You found a bug in my UNION code, and I am not
sure how to fix it.


> ~/data/PG_VERSION contains 6.3, so you may be right, but the HISTORY file
> states that one of the changes from 6.3 to 6.3.1 includes the possibility
> to use 'password' as a column identifier.

If history says 6.3.1 at the top, it is 6.3.1.

> 
> Here's the output from my test system:
> # bus@goliath [1019] =>psql -c 'create table x (password int)'
> # CREATE
> # bus@goliath [1020] =>psql -c 'select distinct * from pg_user union select *
> # from pg_user'
> # PQexec() -- Request was sent to backend, but backend closed the ...

Yes, this crashes things.  I have added to the TODO list:

	* DISTINCT not on last query fails on UNION but not UNION ALL

UNION does an automatic distinct between the two queries

	test=> insert into test1 values (1);
	INSERT 18706 1
	test=> insert into test1 values (1);
	INSERT 18707 1
	test=> insert into test1 values (1);
	INSERT 18708 1
	test=> insert into test2 values (2);
	INSERT 18709 1
	test=> insert into test2 values (2);
	INSERT 18710 1
	test=> select * from test1 union select * from test2;
	x
	-
	1
	2
	(2 rows)

If you use UNION ALL, you don't get distinct, and the query you gave me
would work.

Not sure how to fix it.  Could just disable the DISTINCT's when using
UNION and not UNION ALL, because it is redundant.  Perhaps Vadim has a
comment on this.

t
> 
> On another system that uses 6.3, 'password' isn't a valid id.
> # bus@tardis [1017] =>psql -c 'create table x (password int)'
> # ERROR:  parser: parse error at or near "password"
> 
> I hope I'm not upsetting you (or any of the developers) with my 'here's
> another silly command that crashes the backend'-reports.

Glad you are finding it.  Glad I have a workaround for now.  We will
keep it on the TODO list until it is fixed.


-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Sat, 28 Mar 1998 23:53:56 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: (PM) Re: [HACKERS] Ways to crash the backend