Re: [SQL] psql -f COPY from STDIN

2010-11-12 Thread Tom Lane
Tarlika Elisabeth Schmitz writes: > The following command works fine when pasing it to psql via the -c > option: > cat event.csv | \ > psql -c "COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL > AS ''" > When executed from a file via -f, it does nothing (no error messages > either):

Re: [SQL] psql -f COPY from STDIN

2010-11-12 Thread Adrian Klaver
On 11/12/2010 02:03 PM, Tarlika Elisabeth Schmitz wrote: The following command works fine when pasing it to psql via the -c option: cat event.csv | \ psql -c "COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL AS ''" When executed from a file via -f, it does nothing (no error message

[SQL] psql -f COPY from STDIN

2010-11-12 Thread Tarlika Elisabeth Schmitz
The following command works fine when pasing it to psql via the -c option: cat event.csv | \ psql -c "COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL AS ''" When executed from a file via -f, it does nothing (no error messages either): event.sql: COPY (event_id, event_name) FROM STD

Re: [SQL] Overlapping Ranges- Query Alternative

2010-11-12 Thread Ozer, Pam
Thank you all for your suggestions. I will try each of these and see which one fits my situation best. From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Andreas Gaab Sent: Friday, November 12, 2010 12:23 AM To: Ozer, Pam; pgsql-sql@postgresql.org Subject:

Re: [SQL] "slow lock" log in addition to log_min_duration_statement ?

2010-11-12 Thread Joshua Tolley
On Wed, Nov 10, 2010 at 12:28:46PM -0800, Bryce Nesbitt wrote: > I have a cluster with log_min_duration_statement set to log slow > queries. Presently what I'm tracking down is almost certainly a lock > problem. Is there any analog of log_min_duration_statement for locks? > If there is a lo

Re: [SQL] Overlapping Ranges- Query Alternative

2010-11-12 Thread Marc Mamin
or: Select Groups, generate_series FROM ranges JOIN generate_series(10,50,10) on ( ColumnA < generate_series) ORDER by Groups , generate_series ; regards, Marc Mamin From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Andreas Gaa

Re: [SQL] Overlapping Ranges- Query Alternative

2010-11-12 Thread Andreas Gaab
Hi, the following works: Create temp table ranges (Groups int, ColumnA int); Insert into ranges Values(2,45); Insert into ranges Values(3,15); Insert into ranges Values(4,25); Insert into ranges Values(5,35); Select Groups, Case when ColumnA between 0 and 19 then 0 when ColumnA >=20 AND Col