Fwd: [GENERAL] triggers and execute...

2009-05-01 Thread Dimitri Fontaine
Hi, it seems it didn't make it the first time. Début du message réexpédié : De : Dimitri Fontaine Date : 30 avril 2009 12:03:10 HAEC À : pgsql-general@postgresql.org Objet : Rép : [GENERAL] triggers and execute... On Monday 27 April 2009 22:32:22 Scott Marlowe wrote: OK, I'm hitt

Re: [GENERAL] triggers and execute...

2009-05-01 Thread Alban Hertroys
On Apr 29, 2009, at 4:20 AM, Scott Marlowe wrote: Oh man, it just gets worse. I really need a simple elegant solution here, because if I try to build the query by hand null inputs make life a nightmare. I had built something like this: q = 'insert into '||schem||'.page_access_'||part||' value

Re: [GENERAL] triggers and execute...

2009-05-01 Thread Scott Marlowe
On Tue, Apr 28, 2009 at 10:46 PM, David Fetter wrote: > On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote: >> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma >> wrote: >> > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe >> > wrote: >> >> OK, I'm hitting a wall here.  I've written

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Richard Broersma
I wonder if it would be easier to perodically replace the entire trigger function with one that inserts to the correct table using CRON+SED rather than dynamically building SQL. This might be a bad idea however. I'm just thinking outside the box. -- Regards, Richard Broersma Jr. Visit the Los

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Scott Marlowe
On Wed, Apr 29, 2009 at 4:23 AM, Alban Hertroys wrote: > On Apr 29, 2009, at 4:20 AM, Scott Marlowe wrote: > >> Oh man, it just gets worse.  I really need a simple elegant solution >> here, because if I try to build the query by hand null inputs make >> life a nightmare.  I had built something lik

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Alvaro Herrera
Scott Marlowe escribió: > Oh man, it just gets worse. I really need a simple elegant solution > here, because if I try to build the query by hand null inputs make > life a nightmare. I had built something like this: > > q = 'insert into '||schem||'.page_access_'||part||' values ( >

Re: [GENERAL] triggers and execute...

2009-04-30 Thread David Fetter
On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote: > On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma > wrote: > > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe > > wrote: > >> OK, I'm hitting a wall here.  I've written this trigger for partitioning: > >> > >> create or replace fun

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Scott Marlowe
On Tue, Apr 28, 2009 at 11:24 PM, Scott Marlowe wrote: > On Tue, Apr 28, 2009 at 10:46 PM, David Fetter wrote: >> On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote: >>> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma >>> wrote: >>> > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Dimitri Fontaine
On Monday 27 April 2009 22:32:22 Scott Marlowe wrote: > OK, I'm hitting a wall here. I've written this trigger for partitioning: > > create or replace function page_access_insert_trigger () > returns trigger as $$ > DECLARE > part text; > q text; > BEGIN > part = to_char(new."tim

Re: [GENERAL] triggers and execute...

2009-04-29 Thread Erik Jones
On Apr 29, 2009, at 4:14 AM, Jasen Betts wrote: On 2009-04-29, Scott Marlowe wrote: On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma wrote: On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe > wrote: OK, I'm hitting a wall here. I've written this trigger for partitioning: create or replace

Re: [GENERAL] triggers and execute...

2009-04-29 Thread Jasen Betts
On 2009-04-29, Scott Marlowe wrote: > On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma > wrote: >> On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe >> wrote: >>> OK, I'm hitting a wall here.  I've written this trigger for partitioning: >>> >>> create or replace function page_access_insert_trigger

Re: [GENERAL] triggers and execute...

2009-04-28 Thread Scott Marlowe
On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma wrote: > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe > wrote: >> OK, I'm hitting a wall here.  I've written this trigger for partitioning: >> >> create or replace function page_access_insert_trigger () >> returns trigger as $$ >> DECLARE >>  

Re: [GENERAL] triggers and execute...

2009-04-28 Thread Sam Mason
On Mon, Apr 27, 2009 at 03:37:22PM -0600, Scott Marlowe wrote: > On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma wrote: > > At this point I don't think that there is a way for this function to > > know the correct table type of new.* since page_access_... is still > > only a concatenated string.

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Scott Marlowe
On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma wrote: > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe > wrote: >> OK, I'm hitting a wall here.  I've written this trigger for partitioning: >> >> create or replace function page_access_insert_trigger () >> returns trigger as $$ >> DECLARE >>  

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Richard Broersma
On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe wrote: > OK, I'm hitting a wall here.  I've written this trigger for partitioning: > > create or replace function page_access_insert_trigger () > returns trigger as $$ > DECLARE >        part text; >        q text; > BEGIN >        part = to_char(new.

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Scott Marlowe
On Mon, Apr 27, 2009 at 2:32 PM, Scott Marlowe wrote: > OK, I'm hitting a wall here.  I've written this trigger for partitioning: > > create or replace function page_access_insert_trigger () > returns trigger as $$ > DECLARE >        part text; >        q text; > BEGIN >        part = to_char(new.

[GENERAL] triggers and execute...

2009-04-27 Thread Scott Marlowe
OK, I'm hitting a wall here. I've written this trigger for partitioning: create or replace function page_access_insert_trigger () returns trigger as $$ DECLARE part text; q text; BEGIN part = to_char(new."timestamp",'MMDD'); q = 'insert into page_access_'||part