Re: [SQL] query not using index for descending records?

2004-01-30 Thread email lists
Hi, | You probably don't want to do that. The DESC only applies to the | one expression it follows. What you want is probably: | explain select datetime,id from trafficlogs order by | datetime desc,id desc limit 20; This is exactly what I was after - worked a treat! Thanks. Darren -

PROBLEM SOLVEDRe: [SQL] java.lang.StringIndexOutOfBoundsException: String index

2004-01-30 Thread mohan
Thank you all guys. Thank you very much. Yeah it was the driver issue. I was runnin postgres 7.4 but using the pg73jdbc3.jar driver. I did not know that. Thank you all once again for your help. --mohan > O kyrios [EMAIL PROTECTED] egrapse stis Jan 29, 2004 : > >> Now i a get another wierd error

Re: [SQL] Empty String Comparison Standard compliant?

2004-01-30 Thread Stephan Szabo
On Fri, 30 Jan 2004, Christoph Haller wrote: > Just a short question (PostgreSQL 7.3.4 on hppa-hp-hpux10.20, compiled by GCC 2.8.1) > > SELECT ('' > 'GDMF') ; SELECT ('GDMF' > ''); > ?column? > -- > f > (1 row) > > ?column? > -- > t > (1 row) > > Are these results standard com

Re: [SQL] Empty String Comparison Standard compliant?

2004-01-30 Thread Tom Lane
Christoph Haller <[EMAIL PROTECTED]> writes: > [ '' is less than 'GDMF' ] > Are these results standard compliant? I doubt that the SQL standard really says anything on the subject, but ISTM any rational string-sorting algorithm would put '' before anything else. > It's just because I have a DBM

[SQL] Empty String Comparison Standard compliant?

2004-01-30 Thread Christoph Haller
Just a short question (PostgreSQL 7.3.4 on hppa-hp-hpux10.20, compiled by GCC 2.8.1) SELECT ('' > 'GDMF') ; SELECT ('GDMF' > ''); ?column? -- f (1 row) ?column? -- t (1 row) Are these results standard compliant? Looks at least pretty reasonable to me. It's just because I

Re: [SQL] limit 1 and functional indexes: SOLVED

2004-01-30 Thread Greg Stark
"Alexandra Birch" <[EMAIL PROTECTED]> writes: > It works perfectly - thanks a million! > Strangely the offset 0 does not seem to make any difference. > Gotta read up more about subqueries :) > > explain analyze > select code,order_date >from ( > select code, order_date >

Re: [SQL] limit 1 and functional indexes: SOLVED

2004-01-30 Thread Alexandra Birch
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: viernes, 30 de enero de 2004 7:08 > > Yeah, the problem with functional indexes is that the optimizer doesn't have > any clue how the records are distributed since it only has statistics for > columns, not your expression. Notice it's est

Re: [SQL] java.lang.StringIndexOutOfBoundsException: String index

2004-01-30 Thread Achilleus Mantzios
O kyrios [EMAIL PROTECTED] egrapse stis Jan 29, 2004 : > Now i a get another wierd error > > DEBUG] Transaction - -called safeRollback with null argument > java.sql.SQLException: ERROR: SET AUTOCOMMIT TO OFF is no longer supported > at org.postgresql.core.QueryExecutor.execute(QueryExecu

[SQL] locking problem

2004-01-30 Thread cheater cheater
hi, can anyone help me out on the following scenario: why this is happening, if i'm doing any thing wrong or its the feature of postgres... regards cheetor PostgreSQL Steps: 1. Create a table create table mytab (name va