Re: [GENERAL] Multiple multithreaded insert

2016-10-14 Thread FarjadFarid(ChkNet)
<pgsql-general@postgresql.org> Subject: [GENERAL] Multiple multithreaded insert Hi, everyone! I have a table: create table testpr(id serial,priority integer,unique(priority) DEFERRABLE, primary key(id)); and a trigger which, when added to this table, automatically sets pr

Re: [GENERAL] Multiple multithreaded insert

2016-10-14 Thread Scott Marlowe
On Fri, Oct 14, 2016 at 7:12 AM, Арсен Арутюнян wrote: > Hi, everyone! > > I have a table: > > create table testpr(id serial,priority integer,unique(priority) DEFERRABLE, > primary key(id)); > This: > and a trigger which, when added to this table, automatically sets priority > as

[GENERAL] Multiple multithreaded insert

2016-10-14 Thread Арсен Арутюнян
Hi, everyone! I have a table: create table testpr(id serial,priority integer,unique(priority) DEFERRABLE, primary key(id)); and a trigger which, when added to this table, automatically sets priority as the maximum value +1 CREATE OR REPLACE FUNCTION PriorityCheck() RETURNS trigger AS $$ BEGIN