Re: [DOCS] Partitioning documentation example

2008-02-05 Thread Tom Lane
Decibel! <[EMAIL PROTECTED]> writes: > On Fri, Jan 04, 2008 at 12:25:59PM -0500, Tom Lane wrote: >> That won't actually work. > I think it's still worthy as an example. I think what we have here is a failure to communicate. How are you going to do performance measurement on something that does n

Re: [DOCS] Partitioning documentation example

2008-02-05 Thread Decibel!
On Fri, Jan 04, 2008 at 12:25:59PM -0500, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > >EXECUTE 'INSERT INTO measurement_y' || > > to_char(NEW.logdate,'_mMM') || ' VALUES (NEW.*)'; > > That won't actually work. Even if it did, I don't think we should be > recommendin

Re: [DOCS] Partitioning documentation example

2008-01-05 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Because my EXECUTE example didn't work I have created a new example > > using date_trunc(), which I think is less error-prone than the > > comparisons done in the original example: > > This is not an improvement either. You can't rep

Re: [DOCS] Partitioning documentation example

2008-01-05 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Because my EXECUTE example didn't work I have created a new example > using date_trunc(), which I think is less error-prone than the > comparisons done in the original example: This is not an improvement either. You can't represent the check constraints

Re: [DOCS] Partitioning documentation example

2008-01-05 Thread Bruce Momjian
bruce wrote: > Simon, I was looking at the new table partitioning documentation that > recommends triggers: > > > http://developer.postgresql.org/pgdocs/postgres/ddl-partitioning.html#DDL-PARTITIONING-IMPLEMENTATION > > and came upon this trigger function example: > > CREATE OR REPL

Re: [DOCS] Partitioning documentation example

2008-01-04 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > >EXECUTE 'INSERT INTO measurement_y' || > > to_char(NEW.logdate,'_mMM') || ' VALUES (NEW.*)'; > > That won't actually work. Even if it did, I don't think we should be > recommending use of EXECUTE here; the performance imp

Re: [DOCS] Partitioning documentation example

2008-01-04 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > EXECUTE 'INSERT INTO measurement_y' || > to_char(NEW.logdate,'_mMM') || ' VALUES (NEW.*)'; That won't actually work. Even if it did, I don't think we should be recommending use of EXECUTE here; the performance implications are bad.

Re: [DOCS] Partitioning documentation example

2008-01-04 Thread Bruce Momjian
Simon Riggs wrote: > On Fri, 2008-01-04 at 10:27 -0500, Bruce Momjian wrote: > > > It seems to me it would be much clearer if we added a second example > > that used to_char() to create the INSERT statement dynamically based on > > NEW.logdate: > > > > CREATE OR REPLACE FUNCTION measurement_i

Re: [DOCS] Partitioning documentation example

2008-01-04 Thread Simon Riggs
On Fri, 2008-01-04 at 10:27 -0500, Bruce Momjian wrote: > It seems to me it would be much clearer if we added a second example > that used to_char() to create the INSERT statement dynamically based on > NEW.logdate: > > CREATE OR REPLACE FUNCTION measurement_insert_trigger() > RETURN