Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
On Fri, Jan 28, 2011 at 2:57 AM, Scott Marlowe wrote: > On Thu, Jan 27, 2011 at 10:50 AM, Amitabh Kant > wrote: > > Hi > > > > I am trying to write a function which is being called from a trigger used > > for partitioning a large table. The partitioning is to happen based on an > > integer field

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
On Fri, Jan 28, 2011 at 2:40 AM, Viktor Bojović wrote: > when creating dynamic query try to store it completey as string because you > will not be able to change tableName (i havent been doing that for a long > time , so possibly i can be wrong). > to "exec" or "execute" command you have to pass t

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Scott Marlowe
On Thu, Jan 27, 2011 at 10:50 AM, Amitabh Kant wrote: > Hi > > I am trying to write a function which is being called from a trigger used > for partitioning a large table. The partitioning is to happen based on an > integer field (testing_id). A simplified structure of what I am trying to do > is w

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Viktor Bojović
when creating dynamic query try to store it completey as string because you will not be able to change tableName (i havent been doing that for a long time , so possibly i can be wrong). to "exec" or "execute" command you have to pass the query as parameter. it would look like this declare sql as v

[SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
Hi I am trying to write a function which is being called from a trigger used for partitioning a large table. The partitioning is to happen based on an integer field (testing_id). A simplified structure of what I am trying to do is written below. Create Table tbltesting( testing_id int not null,

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
On Thu, Jan 27, 2011 at 11:20 PM, Amitabh Kant wrote: > Hi > > I am trying to write a function which is being called from a trigger used > for partitioning a large table. The partitioning is to happen based on an > integer field (testing_id). A simplified structure of what I am trying to do > is w