Re: [GENERAL] Partition Help

2015-04-30 Thread akshunj
Hi Jim, I'm not going the partitioning route because I want to, I'm just out of options at this point. As this table gets bigger, performance just gets worse over time. I wanted to try partitioning to see if it helps. Thanks for the tip, looking at the function again what you suggest makes

Re: [GENERAL] Partition Help

2015-04-30 Thread akshunj
Melvin, thanks. Syntax was indeed the problem there. Any idea how to pass the original query to the child table? My insert has 113 parameters passed in, but based on the constraint violations I am seeing, it seems they are not making. I suspect that: VALUE (NEW.*) does not pass in the original

Re: [GENERAL] Partition Help

2015-04-30 Thread Melvin Davidson
Rick, I am glad I could help, but I am not quite sure you understand the purpose/use of the trigger to partition the table. The trigger merely decides which child should get the data, the query is not passed, only the data, To be more specific, if your appropriate child table were child_1000,

[GENERAL] Partition Help

2015-04-29 Thread akshunj
Hi, I am trying to setup partitions and as a test, I was able to follow the example in the Postgres docs using the date as a condition. Now I am trying to partition on a column with the data type character varying. I want to partition based on an invoice ID consisting on letters and numbers

Re: [GENERAL] Partition Help

2015-04-29 Thread Melvin Davidson
I think the problem is you need to specify NEW.invoice in all comparisons (don't quote the 'column')and always, Always, ALWAYS end each statement with a semicolon. IE: IF (NEW.invoice = 'I-1') THEN INSERT INTO myschema.mywork VALUES (NEW.*) ELSE IF (NEW.invoice = 'I-10001' AND NEW.invoice =

Re: [GENERAL] Partition Help

2015-04-29 Thread Jim Nasby
On 4/29/15 10:05 AM, akshunj wrote: IF ('invoice' = 'I-1') THEN INSERT INTO myschema.mywork VALUES (NEW.*) ELSE IF ('invoice' = 'I-10001' AND = 'I-2' That's going to fall apart with invoice I-10. If you're going to go this route, depend on how IF ELSIF operates and don't try to