pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
7+ messages / 5 participants
[nested] [flat]

* pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
@ 2009-05-12 16:43 Tom Lane <tgl@postgresql.org>
  2009-05-12 20:50 ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Simon Riggs <simon@2ndQuadrant.com>
  0 siblings, 1 reply; 7+ messages in thread

From: tgl@postgresql.org @ 2009-05-12 16:43 UTC (permalink / raw)
  To: pgsql-committers

Log Message:
-----------
Fix LOCK TABLE to eliminate the race condition that could make it give weird
errors when tables are concurrently dropped.  To do this we must take lock
on each relation before we check its privileges.  The old code was trying
to do that the other way around, which is a bit pointless when there are lots
of other commands that lock relations before checking privileges.  I did keep
it checking each relation's privilege before locking the next relation, which
is a detail that ALTER TABLE isn't too picky about.

Modified Files:
--------------
    pgsql/src/backend/access/heap:
        heapam.c (r1.274 -> r1.275)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/heapam.c?r1=1.274&r2=1.27...)
    pgsql/src/backend/commands:
        lockcmds.c (r1.23 -> r1.24)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/lockcmds.c?r1=1.23&r2=1.24)
    pgsql/src/include/access:
        heapam.h (r1.141 -> r1.142)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/heapam.h?r1=1.141&r2=1.142)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
  2009-05-12 16:43 pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@postgresql.org>
@ 2009-05-12 20:50 ` Simon Riggs <simon@2ndQuadrant.com>
  2009-05-12 21:10   ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Simon Riggs @ 2009-05-12 20:50 UTC (permalink / raw)
  To: Tom Lane <tgl@postgresql.org>; +Cc: pgsql-hackers@postgresql.org


On Tue, 2009-05-12 at 16:43 +0000, Tom Lane wrote:

> Fix LOCK TABLE to eliminate the race condition that could make it give weird
> errors when tables are concurrently dropped.  To do this we must take lock
> on each relation before we check its privileges.  The old code was trying
> to do that the other way around, which is a bit pointless when there are lots
> of other commands that lock relations before checking privileges.  I did keep
> it checking each relation's privilege before locking the next relation, which
> is a detail that ALTER TABLE isn't too picky about.

If we're going to require cascaded permissions like this, would it make
sense to make GRANT cascade down the inheritance tree also? 

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
  2009-05-12 16:43 pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@postgresql.org>
  2009-05-12 20:50 ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Simon Riggs <simon@2ndQuadrant.com>
@ 2009-05-12 21:10   ` Tom Lane <tgl@sss.pgh.pa.us>
  2009-05-12 21:15     ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Simon Riggs <simon@2ndQuadrant.com>
  2009-06-02 18:33     ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Bruce Momjian <bruce@momjian.us>
  0 siblings, 2 replies; 7+ messages in thread

From: Tom Lane @ 2009-05-12 21:10 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: pgsql-hackers@postgresql.org

Simon Riggs <simon@2ndquadrant.com> writes:
> If we're going to require cascaded permissions like this, would it make
> sense to make GRANT cascade down the inheritance tree also? 

That's been discussed before.  I forget whether we decided it was a good
idea or not, but in any case it looks like a new feature not a bug fix.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
  2009-05-12 16:43 pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@postgresql.org>
  2009-05-12 20:50 ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Simon Riggs <simon@2ndQuadrant.com>
  2009-05-12 21:10   ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@sss.pgh.pa.us>
@ 2009-05-12 21:15     ` Simon Riggs <simon@2ndQuadrant.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Simon Riggs @ 2009-05-12 21:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@postgresql.org


On Tue, 2009-05-12 at 17:10 -0400, Tom Lane wrote:
> Simon Riggs <simon@2ndquadrant.com> writes:
> > If we're going to require cascaded permissions like this, would it make
> > sense to make GRANT cascade down the inheritance tree also? 
> 
> That's been discussed before.  I forget whether we decided it was a good
> idea or not, but in any case it looks like a new feature not a bug fix.

Agreed. I was just trying to think ahead to the implications and
difficulties of the LOCK and TRUNCATE changes and see if anything else
important emerged.

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
  2009-05-12 16:43 pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@postgresql.org>
  2009-05-12 20:50 ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Simon Riggs <simon@2ndQuadrant.com>
  2009-05-12 21:10   ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@sss.pgh.pa.us>
@ 2009-06-02 18:33     ` Bruce Momjian <bruce@momjian.us>
  2009-06-04 08:38       ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Simon Riggs <simon@2ndQuadrant.com>
  1 sibling, 1 reply; 7+ messages in thread

From: Bruce Momjian @ 2009-06-02 18:33 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Simon Riggs <simon@2ndquadrant.com>; pgsql-hackers@postgresql.org

Tom Lane wrote:
> Simon Riggs <simon@2ndquadrant.com> writes:
> > If we're going to require cascaded permissions like this, would it make
> > sense to make GRANT cascade down the inheritance tree also? 
> 
> That's been discussed before.  I forget whether we decided it was a good
> idea or not, but in any case it looks like a new feature not a bug fix.

Is this a TODO?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
  2009-05-12 16:43 pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@postgresql.org>
  2009-05-12 20:50 ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Simon Riggs <simon@2ndQuadrant.com>
  2009-05-12 21:10   ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@sss.pgh.pa.us>
  2009-06-02 18:33     ` Re: [COMMITTERS] pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Bruce Momjian <bruce@momjian.us>
@ 2009-06-04 08:38       ` Simon Riggs <simon@2ndQuadrant.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Simon Riggs @ 2009-06-04 08:38 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers@postgresql.org


On Tue, 2009-06-02 at 14:33 -0400, Bruce Momjian wrote:
> Tom Lane wrote:
> > Simon Riggs <simon@2ndquadrant.com> writes:
> > > If we're going to require cascaded permissions like this, would it make
> > > sense to make GRANT cascade down the inheritance tree also? 
> > 
> > That's been discussed before.  I forget whether we decided it was a good
> > idea or not, but in any case it looks like a new feature not a bug fix.
> 
> Is this a TODO?

Yes.

Whatever was discussed before was prior to the changes to make TRUNCATE
and LOCK TABLE cascade. The cascading will fail without appropriate
permissions, so GRANT should work that way also, now.

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Shrink test file for test_json_parser module
@ 2024-04-12 14:59 Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Dunstan @ 2024-04-12 14:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Shrink test file for test_json_parser module

Also delete live URLs

Jacob Champion

Discussion: https://postgr.es/m/CAOYmi+mtH=V1wZKAOauCd5QqQWr61hnXMJbJ9h-CZXAa1JXd3w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b8a7bfa33324bc40c7180cb946a39378fb48309c

Modified Files
--------------
src/test/modules/test_json_parser/tiny.json |   515 +-
src/test/modules/test_json_parser/tiny.out  | 19346 +-------------------------
2 files changed, 192 insertions(+), 19669 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2024-04-12 14:59 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 16:43 pgsql: Fix LOCK TABLE to eliminate the race condition that could make it Tom Lane <tgl@postgresql.org>
2009-05-12 20:50 ` Simon Riggs <simon@2ndQuadrant.com>
2009-05-12 21:10   ` Tom Lane <tgl@sss.pgh.pa.us>
2009-05-12 21:15     ` Simon Riggs <simon@2ndQuadrant.com>
2009-06-02 18:33     ` Bruce Momjian <bruce@momjian.us>
2009-06-04 08:38       ` Simon Riggs <simon@2ndQuadrant.com>
2024-04-12 14:59 pgsql: Shrink test file for test_json_parser module Andrew Dunstan <andrew@dunslane.net>

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