Two questions about 6.5
Two questions about 6.5
От:
Christian Ullrich <ChrUllrich@gmx.de>
Дата:
Hello all, I have two questions about PostgreSQL 6.5: 1. CLUSTER does not work on indexes with more than one field. Is this correct? 2. In the distribution tarball, the top-level directory is "postgresl-6.5". Isn't there a 'q' missing? -- Christian Ullrich
Problem with perl / postgres
От:
Chris Bitmead <chris.bitmead@bigfoot.com>
Дата:
I've got this simple query... SELECT id, title, summary, datetime, datetime::date AS date FROM poll WHERE id = ? which works from psql but fails with "bad parameter" from perl. If I take out the "datetime::date AS date" bit it starts working. Why would a query work in psql but not perl? -- Chris Bitmead mailto:chris@tech.com.au http://www.techphoto.org - Photography News, Stuff that Matters
Re: [GENERAL] Two questions about 6.5
От:
Bruce Momjian <maillist@candle.pha.pa.us>
Дата:
> Hello all, > > I have two questions about PostgreSQL 6.5: > > 1. CLUSTER does not work on indexes with more than one field. Is this > correct? It seems to work here: test=> create table te(x int, y int); CREATE test=> create index i_te on te(x,y); CREATE test=> cluster i_te on te; CLUSTER Can you supply and example. > 2. In the distribution tarball, the top-level directory is > "postgresl-6.5". Isn't there a 'q' missing? I believe this has been corrected. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Re: [GENERAL] Problem with perl / postgres
От:
Stuart Rison <stuart@ludwig.ucl.ac.uk>
Дата:
Hi Chris, I don't know why it works in psql but not in perl but I've had problems casting datetime as date before. In pg 6.4 the cast fails (and by that I mean it yields an error) if datetime is NULL. A possible 'workaround' is to double-cast: select date( abstime( dt ) ) from test1; Now because your query works in psql but not in perl, I don't think that casting of NULLs is likely to be the problem but hey, it's worth a shot. On a final note, I think datetime and date are reserved keywords so it's probably best to rename your attribute 'datetime' and your synonym 'date'! HTH, Stuart. >I've got this simple query... > >SELECT id, title, summary, datetime, datetime::date AS date FROM poll >WHERE id = ? > >which works from psql but fails with "bad parameter" from perl. If I >take out the "datetime::date AS date" bit it starts working. > >Why would a query work in psql but not perl? > >-- >Chris Bitmead >mailto:chris@tech.com.au >http://www.techphoto.org - Photography News, Stuff that Matters +-------------------------+--------------------------------------+ | Stuart Rison | Ludwig Institute for Cancer Research | +-------------------------+ 91 Riding House Street | | Tel. (0171) 878 4041 | London, W1P 8BT, UNITED KINGDOM. | | Fax. (0171) 878 4040 | stuart@ludwig.ucl.ac.uk | +-------------------------+--------------------------------------+