[SQL] Truncate on pg_dump / pg_restore

2008-10-24 Thread Bryce Nesbitt
Dear Postgres Gurus; Is there a way to truncate a table, at pg_dump time? I'm aware of various ways to exclude a table from a dump (>= 8.2), or to selectively pg_restore. What I'm seeking here is different. I've got tables with pretty disposable data... meaning I want to drop the data... but re

Re: [SQL] grouping/clustering query

2008-10-24 Thread David Garamond
Tony, Joe, Steve, Thanks for the follow-ups. Yes, the problem is related to double-entry accounting, where one needs to balance total debit and credit (payments and invoices) in each journal/transaction. Due to time constraint, I ended up doing this in the client-side programming language, since

Re: [SQL] grouping/clustering query

2008-10-24 Thread Tony Wasson
On Fri, Oct 24, 2008 at 10:24 AM, Tony Wasson <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 8:04 AM, Steve Midgley <[EMAIL PROTECTED]> wrote: >> At 11:28 AM 10/23/2008, Joe wrote: >>> >>> Steve Midgley wrote: > > # (invoiceid, txid) > (A, 1) > (A, 3) > (B, 1) > (B, 2)

Re: [SQL] grouping/clustering query

2008-10-24 Thread Tony Wasson
On Fri, Oct 24, 2008 at 8:04 AM, Steve Midgley <[EMAIL PROTECTED]> wrote: > At 11:28 AM 10/23/2008, Joe wrote: >> >> Steve Midgley wrote: # (invoiceid, txid) (A, 1) (A, 3) (B, 1) (B, 2) (C, 5) (D, 6) (D, 7) (E, 8) (F, 8) For journalli

Re: [SQL] grouping/clustering query

2008-10-24 Thread Oliveiros Cristina
Your script is handy, Steve. Spontaneously, This seems to be an array type problem, something I just have vague notions about. I'll take a look at this, http://www.postgresql.org/docs/8.3/static/arrays.html to see if something occurs... Best, Oliveiros - Original Message - From:

Re: [SQL] grouping/clustering query

2008-10-24 Thread Steve Midgley
At 11:28 AM 10/23/2008, Joe wrote: Steve Midgley wrote: # (invoiceid, txid) (A, 1) (A, 3) (B, 1) (B, 2) (C, 5) (D, 6) (D, 7) (E, 8) (F, 8) For journalling, I need to group/cluster this together. Is there a SQL query that can generate this output: # (journal: invoiceids, txids) [A,B] , [1,2,3