Actually it seems that no explicit lock is required, asx you can read in postgresl manual (v7.3) :
LOCK [ TABLE ] name [, ...] IN lockmode MODE
ROW EXCLUSIVE MODE
Note: The commands UPDATE, DELETE, and INSERT acquire this lock mode on the target table (in addition to ACCESS SHARE locks on any...
So here is my problem answer, if anybody needs it...
I created a plpgsql function returning the max value + 1 of the given column name in arguments (must be quoted with ') and if there is no value (empty table) returns 1.
In the create table definition, i removed the serial datatype and...
This is good... but...
I need an ordered sequence number, there will be no delete on this table, so, is anybody knows an effecient way to do so in postgres?
Thanks for your help
Hi, i would like to know if there is any way to bypass this sequence problem?
...
create table myTable
(
pk SERIAL PRIMARY KEY,
value varchar check(value!='')
);
==>insert into myTable (value) values ('');
==>ERROR: ExecAppend: rejected due to CHECK constraint mytable_value
it's still ok...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.