Re: [GENERAL] I need a Postgres Admin $130K + 20K in NYC Any Ideas?

2009-09-16 Thread Hoover, Jeffrey
All right children. Recess is over, get back to work. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Ed Koch Sent: Wednesday, September 16, 2009 8:27 AM To: 'mgai...@hotmail.com'; 'g...@seespotcode.net' Cc: 'dmag...@gm

Re: [GENERAL] Need help to dynamically access to colomns in function!

2008-12-16 Thread Hoover, Jeffrey
Create a plpgsql function that reformats your row as an array. Example: I have a table named task_parameter with three columns: Table "camera.task_parameter" Column | Type | Modifiers --+-

Re: [GENERAL] The planner hates me.

2008-09-29 Thread Hoover, Jeffrey
change t.date2< dates.date to t.date2+0= dates.date) and t.date2+0mailto:[EMAIL PROTECTED] On Behalf Of Jeff Amiel Sent: Thursday, September 25, 2008 10:24 AM To: pgsql-general@postgresql.org Subject: [GENERAL] The planner hates me. "PostgreSQL 8.2.4 on i386-pc-solaris2.10, compiled by GCC gcc (G

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-22 Thread Hoover, Jeffrey
minor refinement on suggestion: -- CTAS (create table as) is easiest way to create table with same structure create table foo as select * from orig_table; -- truncate is much more efficient than delete truncate orig_table; -- unchanged insert into orig_table select * from foo; -- recompute statist

Re: [GENERAL] Complicated GROUP BY

2008-07-11 Thread Hoover, Jeffrey
This will also work as long as the table isn't large or product is indexed. actually,its more likely product is indexed that criteria_1 or _2... Note: in this case when there is a tie one provider is arbitrarily selected select mx.product, mx.max_criteria_1, (select provider fro

Re: [GENERAL] Complicated GROUP BY

2008-07-11 Thread Hoover, Jeffrey
if criteria_1 and _2 are indexed: select mx.product, p1.provider as best_provider_1, mx.max_criteria_1, p2.provider as best_provider_2 mx.max_criteria_2 from (select product, max(criteria_1) as max_criteria_1, max(criteria_2) as max_criteria_2 from products_provi

Recall: [GENERAL] Complicated GROUP BY

2008-07-11 Thread Hoover, Jeffrey
Hoover, Jeffrey would like to recall the message, "[GENERAL] Complicated GROUP BY".

Re: [GENERAL] Changing column names in tables

2008-03-06 Thread Hoover, Jeffrey
Why are there too many to fix with ALTER? Use SQL and the data dictionary to generate the DDL and pipe it into psql (or spool it to disk and use that file as a sql script): psql your_db_name -t -c "select 'alter table '||t.tablename||' rename \"'||c.column_name||'\" to '||lower(c.column_name)||