[SQL] Partitioned Tables

2012-06-12 Thread Wayne Cuddy
I'm using partitioned tables where a child table is chosen based on a time stamp. One child table exists for each month. I move records from a temp table to the partitioned table via something like this: INSERT INTO parent_table SELECT * FROM temp_table; All works well but with when inserting to

[SQL] how to use schema with data type

2012-06-12 Thread John Fabiani
I have tried to use a user defined data type I created within a schema. But I could not figure it out. CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date) RETURNS SETOF xchromasun.weekly_mpr AS CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date) RETURNS SETOF "xchromasu

Re: [SQL] Partitioned Tables

2012-06-12 Thread Craig Ringer
On 06/13/2012 08:05 AM, Wayne Cuddy wrote: I'm using partitioned tables where a child table is chosen based on a time stamp. One child table exists for each month. I move records from a temp table to the partitioned table via something like this: INSERT INTO parent_table SELECT * FROM temp_tabl

Re: [SQL] how to use schema with data type

2012-06-12 Thread Craig Ringer
On 06/13/2012 08:46 AM, John Fabiani wrote: I have tried to use a user defined data type I created within a schema. But I could not figure it out. CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date) RETURNS SETOF xchromasun.weekly_mpr AS CREATE OR REPLACE FUNCTION xchromasun._chrom