Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup to How do you select

2003-02-13 Thread Nicholas Allen
Ooops! Appologies to all for being sooo stupid! I thought the order by was applied before the WHERE and if ordering in DESC order for example would mean greater than and so on in the where clause because I assumed meant it would appear before in the returned order. Of course the where just

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup

2003-02-13 Thread Dmitry Tkach
SQL92 says: direct select statement: multiple rows ::= query expression [ order by clause ] [...] 3) Let T be the table specified by the query expression. 4) If ORDER BY is specified, then each sort specification in the order by clause shall identify a column of

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup

2003-02-13 Thread Manfred Koizar
On Thu, 13 Feb 2003 17:50:22 -0500, Dmitry Tkach [EMAIL PROTECTED] wrote: Then it looks like postgres behaviour is still not compliant, if I read it correctly, because select x from mytable order by y; should be invalid according to this, but works just fine in postres. Yes, this is a Postgres

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup

2003-02-13 Thread Tom Lane
Dmitry Tkach [EMAIL PROTECTED] writes: Then it looks like postgres behaviour is still not compliant, if I read it correctly, because select x from mytable order by y; should be invalid according to this, but works just fine in postres. Yup, it's an extension --- as indeed is pointed out at

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup to How do you select

2003-02-13 Thread Nicholas Allen
Because the WHERE clause is directly affected by the ORDER BY clause. If you leave out the order by clause then the row count will be completely different and therefore wrong. The ORDER BY clause is just as important as the WHERE clause when counting rows. It should be possible to get a count