[GENERAL] Protect a table against concurrent data changes while allowing to vacuum it

2016-06-22 Thread Vlad Arkhipov
Hello, I have a constraint that requires a table to be locked before checking it (i.e. no more than 2 records with the same value in the same column). If I lock the table in the SHARE ROW EXCLUSIVE mode, any vacuuming (or autovacuuming) process prevents me from checking the constraint. What a

Re: [GENERAL] Protect a table against concurrent data changes while allowing to vacuum it

2016-06-22 Thread Vlad Arkhipov
. On 06/22/2016 05:20 PM, Sameer Kumar wrote: On Wed, Jun 22, 2016 at 5:10 PM Vlad Arkhipov <mailto:arhi...@dc.baikal.ru>> wrote: Hello, I have a constraint that requires a table to be locked before checking it (i.e. no more than 2 records with the same value in the same

Re: [GENERAL] Protect a table against concurrent data changes while allowing to vacuum it

2016-06-22 Thread Vlad Arkhipov
That is why I need to lock the table before. The transactions are running at the READ COMMITTED isolation level. On 06/22/2016 06:49 PM, Albe Laurenz wrote: But be warned that this will only work if all transactions involved use the isolation level SERIALIZABLE. -- Sent via pgsql-general ma

[GENERAL]

2011-03-09 Thread Vlad Arkhipov
-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Problem with records that disappear.

2013-01-14 Thread Vlad Arkhipov
On 01/14/2013 05:15 PM, Condor wrote: Hello, from some time I have a very strange problem with my postgresql 9.2.2 64bit. I make a few changes with an plp function: BEGIN UPDATE table SET X = X where id = aid; UPDATE table_2 SET Y=Y where id = aid; IF aid > 0 THEN SELECT INTO ids id

[GENERAL] Get RULE condition and commands

2012-06-14 Thread Vlad Arkhipov
What is the proper way of getting RULE condition and commands? The query below does not work. select pg_get_expr(ev_qual, ev_class, true) as condition, pg_get_expr(ev_action, ev_class, true) as commands from pg_rewrite; ERROR: bogus varno: 2 ** Error ** ERROR: bogus va

Re: [GENERAL] Get RULE condition and commands

2012-06-18 Thread Vlad Arkhipov
On 06/16/2012 02:20 AM, Tom Lane wrote: Vlad Arkhipov writes: What is the proper way of getting RULE condition and commands? pg_get_ruledef() regards, tom lane It prints the whole CREATE RULE command. Is there any way to extract WHERE condition of the rule

[GENERAL] txid and current_timestamp

2012-06-25 Thread Vlad Arkhipov
Is it guaranteed that if txid2 > txid1 then current_timestamp in transaction 2 >= current_timestamp in transaction 1? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general