[GENERAL] to know what columns are getting updated

2013-07-29 Thread Sajeev Mayandi
Hi, I have bunch of rules created for tables to implement upsert functionality. My problem is our tables gets updated from multiple places , non –necessarily with the same no of columns. I want to figure out columns are being asked to be updated E.g. The rule for the the table base-tabl

[GENERAL] updatable view

2013-06-10 Thread Sajeev Mayandi
Hi, I am using 9.2. The documentation says that there is no support for updatable view. It suggesting to use the triggers or rule. Can somebody paste the sample code for the same. Thanks, Sajeev

[GENERAL] TRIGGER EVENT

2013-05-29 Thread Sajeev Mayandi
Hi, I am process of porting from sybase to postgresql. Is there syntax equivalent of the TRIGGER EVENT Statement (Please see the sybase help for trigger event below) in Postgresql. NOTE the TRIGGER EVENT in sybase could be used to trigger an user defined event. I am not seeing any similar synta

Re: [GENERAL] Rule for all the tables in a schema

2013-05-23 Thread Sajeev Mayandi
Thanks. I am using 9.2. So will use serge's method. On 5/22/13 11:53 PM, "Sergey Konoplev" wrote: >On Wed, May 22, 2013 at 11:49 PM, Chris Travers >wrote: >> For pre-9.0, just explicitly create, run, and drop a pl/pgsql function. >> Much easier than a shell script. > >+1, good point. > >-- >Ki

[GENERAL] Rule for all the tables in a schema

2013-05-22 Thread Sajeev Mayandi
Hi, I am in the process of creating a rule that provides upsert functionality for all the tables which has primary key.The issue here is we have some 50 to 60 odd tables and have to write a functions that iterates through all these tables , create rules for each of this table, so that the

Re: [GENERAL] DECLARING THE CURSOR WITH HOLD

2013-05-22 Thread Sajeev Mayandi
Is there a work around to declare the cursor with hold? Thanks, Sajeev On 5/22/13 10:19 AM, "Pavel Stehule" wrote: >Hello > >2013/5/22 Sajeev Mayandi : >> >> >> Hi, >> >> I am trying to declare a cursor with hold along with NO SCROLL option. &

[GENERAL] DECLARING THE CURSOR WITH HOLD

2013-05-22 Thread Sajeev Mayandi
Hi, I am trying to declare a cursor with hold along with NO SCROLL option. I am getting syntax error. Just wondering if CURSOR WITH HOLD option supported. My code snip is. DECLARE noncontainer NO SCROLL CURSOR WITH HOLD FOR SELECT * from phostmapping; NOTE: The code is in plpgsql and postg

Re: [GENERAL] upsert functionality

2013-05-16 Thread Sajeev Mayandi
Thank you for true response will try out. Sajeev On 5/16/13 10:27 AM, "Steven Schlansker" wrote: > >On May 15, 2013, at 11:52 PM, Thomas Kellerer wrote: > >> Sajeev Mayandi, 16.05.2013 07:01: >>> Hi, >>> >>> Our company is planning to m

[GENERAL] upsert functionality

2013-05-15 Thread Sajeev Mayandi
Hi, Our company is planning to move to postreSQL. We were initially using sybase where upsert functionality was available using "insert on existing update" clause. I know there multiple ways to fix this using RULE or separate function in postgresql. But I would like to know which version of p