From: rob stone <floriparob@gmail.com>
To: HORDER Phil <Phil.Horder@uk.thalesgroup.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Foreign Key locking / deadlock issue.... v2
Date: Fri, 23 Mar 2018 22:43:01 +1100
Message-ID: <1521805381.3002.8.camel@gmail.com> (raw)
In-Reply-To: <58cedd8d051e40bb887b4a19941b9e5b@XEXWIN0001.one-02-priv.grp>
References: <2d10a11d4b624988a21133d218a95c19@XEXWIN0001.one-02-priv.grp>
<1521717063.3546.3.camel@gmail.com>
<58cedd8d051e40bb887b4a19941b9e5b@XEXWIN0001.one-02-priv.grp>
Hello Phil,
I've run your sample script on 9.6.5 and 10.3.
The only thing that I added was a commit; after the initial inserts
just to ensure the rows were saved.
No errors were reported for either version.
The output of \dp after running was:-
Access privileges
Schema | Name | Type | Access privileges | Column privileges
| Policies
--------+------+-------+-------------------+-------------------+-------
-----------
public | eln | table | | |
public | pl | table | | |
security_policy:+
| | | | | (u):
true
--> including the FOR ALL in the create policy statement as well as
WITH CHECK(true).
Access privileges
Schema | Name | Type | Access privileges | Column privileges
| Policies
--------+------+-------+-------------------+-------------------+-------
-----------
public | eln | table | | |
public | pl | table | | |
security_policy:+
| | | | | (u):
true +
| | | | | (c):
true
The only mystery is what happens here:-
<snip>
-- …. Pause while other processing happens …..
(commit;)
-- Child table processing – occurs often & quickly. Starts after parent
update.
<\snip>
I'd like to know more about RLS and trying to de-bug your script.
On a production application you'd be testing for errors and raising
exceptions so as to inform users that a problem occurred.
So, without knowing what occurs during "Pause while other processing
happens" I can't help any further.
Cheers,
Rob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: floriparob@gmail.com, Phil.Horder@uk.thalesgroup.com
Subject: Re: Foreign Key locking / deadlock issue.... v2
In-Reply-To: <1521805381.3002.8.camel@gmail.com>
References: <2d10a11d4b624988a21133d218a95c19@XEXWIN0001.one-02-priv.grp> <1521717063.3546.3.camel@gmail.com> <58cedd8d051e40bb887b4a19941b9e5b@XEXWIN0001.one-02-priv.grp> <1521805381.3002.8.camel@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox