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

Re: [HACKERS] Upgrades for 6.4.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: PostgreSQL-development <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Upgrades for 6.4.1
Date: 1998-12-19 17:42:49
Message-ID: 5478.914089369@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
"Thomas G. Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu> writes:
>> * SELECT DISTINCT i FROM dtest ORDER BY j generates strange output

> In my simple test case, it orders by j, then only shows i. Is that
> strange?

The thing that is "strange" is that you get nonunique values of i,
which is definitely a bit unexpected for "SELECT DISTINCT":

play=> SELECT * FROM dtest;
i| j
-+--
1|10
1|11
1|12
2|20
3|30
(5 rows)

play=> SELECT DISTINCT i FROM dtest ORDER BY j;
i
-
1
1
1
2
3
(5 rows)

The reason that this is happening is that the "distinct" filter is
actually being run on i,j not just i (see "distinct + order by" thread
in the hackers archives around 8-Nov-98).

I don't know whether the SQL standard defines how this combination of
features ought to work ... but our current behavior seems fairly
surprising...


>> * Allow constraint NULL just as we honor NOT NULL

> Fundamental yacc problem with this as I recall. Gives rise to
> shift/reduce problems since it is ambiguous with other uses of "NULL" in
> the same area.

More to the point, what possible use would a column constrained to NULL
be?  Might as well just not have it in the table...

			regards, tom lane

Responses

pgsql-hackers by date

Next:From: Terry MackintoshDate: 1998-12-19 18:30:10
Subject: Is this a bug? or am I doing some thing wrong?
Previous:From: Trever AdamsDate: 1998-12-19 11:51:12
Subject: BUGS list

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