Re: [SQL] [GENERAL] Problems with Set Returning Functions (SRFs)

2005-04-10 Thread Michael Fuhr
On Wed, Apr 06, 2005 at 03:31:45PM -0700, Otto Blomqvist wrote: > > Just curious, is this (x)-"trick" in the postgres manual somewhere ? Just > just common SQL guru knowledge ? ;) I think the relevant documentation is "Field Selection" in the "Value Expressions" section of the "SQL Syntax" chap

[SQL] Problems with Set Returning Functions (SRFs)

2005-04-10 Thread Otto Blomqvist
Helloo ! We have a database that contains data that we need to Parse. Ideally I would like write a C-function, ParseData, and run select ParseData([data_column]) from datatable where date='2005-05-05'; and have it return 5 columns with the parsed data. Each row in Data_column will potentially c

Re: [SQL] Merging item codes using referential integrity

2005-04-10 Thread Andrus Moor
> Andrus Moor wrote: >> I have item table and a lot of child tables where the items are used. >> I want to merge two item codes into single item in all tables. >> It is not nice to write a lot of separate UPDATE statements for each >> table. >> So I want to utilize REFERENCES clause for merging. >

[SQL] [ocpfree] Problem finding the time difference while tuning a query

2005-04-10 Thread Karthik Dakshinamoorthy
Dear all, Of late, I have been involved in tuning the Performance for a particular program with my project. 1) When you execute a particular query, say if it takes, 1 mins, the second run will always take less time, like 10 msecs etc, the reason is that the second run, benefits fr

[SQL] Getting the output of a function used in a where clause

2005-04-10 Thread Bill Lawrence
HI,   I’m a newbie so please bear with me. I have a function defined (got it from one of your threads… thanks Joe Conway) which calculates the distance  between 2 zip code centeroids (in lat,long). This thing works great. However, I want to sort my results by distance without incurring th

Re: [SQL] Query history file

2005-04-10 Thread Mauro Bertoli
> From the > server side, if you enable 'log_statement' all > queries will go into the > server logs. Thank you, I enabled log_statement = all log_duration = true It's beautiful! :) ___ Nuovo Yahoo! Messenger: E' molto più divertente: Audibles,

Re: [SQL] Date/Time Conversion

2005-04-10 Thread Yasir Malik
beta_jgw=# update scenario1.time_test set local_hour = extract(hour from to_timestamp(to_char(gmt_date,'-MM-DD')||' '||to_char(gmt_hour,'99')||':00:00-00','-MM-DD HH24:MI:SS') at time zone 'EST'); Wild guess, but shouldn't that be :00:00:00? Regards, Yasir

Re: [SQL] [GENERAL] Problems with Set Returning Functions (SRFs)

2005-04-10 Thread Otto Blomqvist
Ofcourse this works perfectly ! Thanks a lot Tom ! Just curious, is this (x)-"trick" in the postgres manual somewhere ? Just just common SQL guru knowledge ? ;) /Otto Blomqvist "Tom Lane" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Otto Blomqvist" <[EMAIL PROTECTED]> w

Re: [SQL] DROP TYPE without error?

2005-04-10 Thread Craig Addleman
I was confronted with a similar problem. I have several scripts which create or modify schemas, and each run in a single transaction. So, dropping a non-existent TYPE will produce a show-stopping error. I wrote this function, and others for various database objects: CREATE OR REPLACE FUNCTION dba

Re: [SQL] subselect query time and loops problem

2005-04-10 Thread Ragnar Hafstað
On Sun, 2005-04-10 at 07:54 -0700, pankaj naug wrote: > [quoting Tom] > >Evidently one has been analyzed much more recently than the other, > because the estimated row counts are wildly different. > > Both the explain/analyse queries has been run at the same time. in that case, is the data the

Re: [SQL] subselect query time and loops problem

2005-04-10 Thread pankaj naug
Thanks Tom,   I am using version 7.3.4, having problems updating to postgres 8 because of cpanel problems.   regarding,   >Evidently one has been analyzed much more recently than the other,because the estimated row counts are wildly different.   Both the explain/analyse queries has been run at the