Re: [GENERAL] Transactions and functions

2016-09-25 Thread amul sul
On Fri, Sep 23, 2016 at 9:14 PM, Арсен Арутюнян wrote: > would you like to help me with several questions: > 1)are all functions atomic? Yes, of course. > 2)are they execute in a single query? Same as executing n-number of SQL statements between BEGIN-COMMIT block. Regards, Amul -- Sent v

Re: [GENERAL] Transactions and functions

2016-09-23 Thread Adrian Klaver
On 09/23/2016 08:44 AM, Арсен Арутюнян wrote: Hello all i have the table create table testpr(id serial,priority integer,unique(priority) DEFERRABLE, primary key(id)); and procedure: CREATE OR REPLACE FUNCTION JobPriorityChange(JobId bigint,NewPrior integer) RETURNS void AS $$ DECLARE PrevPrio

[GENERAL] Transactions and functions

2016-09-23 Thread Арсен Арутюнян
Hello all i have the table create table testpr(id serial,priority integer,unique(priority) DEFERRABLE, primary key(id)); and procedure: CREATE OR REPLACE FUNCTION JobPriorityChange(JobId bigint,NewPrior integer) RETURNS void AS $$ DECLARE PrevPrior integer; BEGIN PrevPrior := (select priority