pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Mark Dilger <hornschnorter@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Missing dependency tracking for TableFunc nodes
Date: Fri, 15 Nov 2019 00:06:46 +0100
Message-ID: <20191114230646.7tohuvuhquy26mou@development> (raw)
In-Reply-To: <20191114222729.GA23410@alvherre.pgsql>
References: <20191114222232.o76u6jdvf53ozjjk@development>
	<20191114222729.GA23410@alvherre.pgsql>

On Thu, Nov 14, 2019 at 07:27:29PM -0300, Alvaro Herrera wrote:
>On 2019-Nov-14, Tomas Vondra wrote:
>
>> Isn't that solved by RemoveObjects() doing this?
>>
>>    /* Get an ObjectAddress for the object. */
>>    address = get_object_address(stmt->removeType,
>>                                 object,
>>                                 &relation,
>>                                 AccessExclusiveLock,
>>                                 stmt->missing_ok);
>>
>> I've actually done some debugging before sending the patch, and I think
>> this prevent the issue you describe.
>
>Hmm .. shouldn't get_statistics_object_oid get a lock on the table that
>owns the stats object too?  I think it should be setting *relp to it.
>That way, the lock you're proposing to add would be obtained there.
>That means it'd be similar to what we do for OBJECT_TRIGGER etc,
>get_object_address_relobject().
>

Hmmm, maybe. We'd have to fake the list of names, because that function
expects the relation name to be included in the list of names, and we
don't have that for extended stats. But it might work, I guess.

>I admit this'd crash and burn if we had stats on multiple relations,
>because there'd be no way to return the multiple relations that would
>end up locked.
>

I think that's less important now. If we ever get that feature, we'll
need to make that work somehow.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 





view thread (18+ messages)  latest in thread

Message-ID: <20191114230646.7tohuvuhquy26mou@development>
Permalink:  ../20191114230646.7tohuvuhquy26mou@development/
Also on:    postgresql.org/message-id/20191114230646.7tohuvuhquy26mou@development

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, hornschnorter@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Missing dependency tracking for TableFunc nodes
  In-Reply-To: <20191114230646.7tohuvuhquy26mou@development>

* 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