Re: [SQL] What this parser mean?

2003-03-20 Thread David Witham
Hi Abdul, You may have lost the '' around the date specification in the to_char function when forming the string in Java. Before submitting the query, check the contents of the query string to make sure you still have the '' marks. Regards, David Witham -Original Mess

Re: [SQL] FUNCTIONS PROBLEM

2003-03-23 Thread David Witham
, val3 real, val4 char); See the SELECT reference page in the documentation. There are other ways (which may be better) to do this that don't require the output types to be specified with the query but this is the one I got going first so I stuck with it. Hope this helps. Regards, David

Re: [SQL] Inquiry From Form [pgsql]

2003-07-02 Thread David Witham
Hi Chris, You need to start a transaction explicitly: Session 1: buns=# begin; BEGIN buns=# create table test_table (col1 int); CREATE TABLE Session 2: buns=# \d test_table Did not find any relation named "test_table". Session 1: buns=# commit; COMMIT Session 2: buns=# \d test_table Tabl

[SQL] Using a compound primary key

2003-07-27 Thread David Witham
QL 7.3.2? I can add another index just on prefix and get a performance increase but it's still not as cost-efficient as using the primary index. Would it be more cost effective to do a bunch of individual queries for each length of prefix until I find one that matches? The average length of a prefix would probably be around 3 digits and I would need to start at 8 digits and work back to cover all possibilities. Thanks for any advice, David Witham ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] Migrating Stored Procedures from MS SQL Server

2003-08-29 Thread David Witham
Hi Kumar,   You'll need to use PL/pgSQL for your stored procedures.   When I migrated from Informix I found it was pretty easy - just a syntactic conversion of the procedures and a few data types to rename. The tricky bit is when you have used a MS SQL Server concept that PostgreSQL doesn't

[SQL] Left outer join on multiple tables

2004-01-11 Thread David Witham
Hi all, Is there a way to do left outer joins on more than 2 tables at once (3 in my case)? Or do I have to do the first join into a temp table and then another join from the temp table to the third table? I can't seem to work out the syntax from the User Guide. Thanks, David Witham Tele

[SQL] Transpose rows to columns

2004-01-12 Thread David Witham
so it displays like this: 991234,ABC,2003-07-01,10,15,5,2003-08-01,11,17,6,2003-09-01,12,19,7 991235,XYZ,2003-07-01,13,21,8,2003-08-01,12,19,7,2003-09-01,11,17,6 (I've used commas to shorten the layout for the example) Does anyone have some ideas on how to do this? Thanks, David W

[SQL] Index question

2004-02-12 Thread David Witham
ndex Cond: (("day" >= '2004-01-27'::date) AND ("day" <= ('now'::text)::date)) (3 rows) I understand that selecting count(*) will involve a scan at some stage, but I was surprised that the index wasn't used in the >= case, but was used in the b

Re: [SQL] Index question

2004-02-12 Thread David Witham
magnitude too low. However, it used the index I wanted and the >= case didn't. Regards, David -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Friday, 13 February 2004 16:38 To: David Witham Cc: [EMAIL PROTECTED] Subject: Re: [SQL] Index question "David

[SQL] Indexes and statistics

2004-02-17 Thread David Witham
some parameters to alter that? Any suggestions appreciated. Thanks, David David Witham Telephony Platforms Architect Unidial, Australia ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "u

Re: [SQL] Indexes and statistics

2004-02-17 Thread David Witham
e. I hope this makes sense. Does it help any? Thanks, David -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wednesday, 18 February 2004 16:10 To: David Witham Cc: [EMAIL PROTECTED] Subject: Re: [SQL] Indexes and statistics "David Witham" <[EMAIL PROTECTED]&g

[SQL] ANALYZE error

2004-03-08 Thread David Witham
m I run at 1am but I don't think it would take an hour to run. Occasionally I get this error message from the analyze job: ERROR: simple_heap_update: tuple concurrently updated What does this mean and should I do anything about it? Thanks, David Witham Telephony Platforms Architect Un

[SQL] Sorting an aggregated column

2004-03-22 Thread David Witham
| y, n, y, 123, 21, 1 2 | y, y, y, 3, 2, 1 This output is correct in this case but there is no guarantee that the answers will come out in "question" order. I can't see how to incorporate sorting by the "question" column using this approach. Can anyone suggest e

Re: [SQL] Sorting an aggregated column

2004-03-22 Thread David Witham
ese rows even though they don't need to be? Regards, David -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Tuesday, 23 March 2004 16:17 To: David Witham Cc: [EMAIL PROTECTED] Subject: Re: [SQL] Sorting an aggregated column "David Witham" <[EMAIL PROTECTED]