pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Joel Jacobson <joel@compiler.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Add primary keys to system catalogs
Date: Tue, 02 Feb 2021 10:17:34 -0500
Message-ID: <3714583.1612279054@sss.pgh.pa.us> (raw)
In-Reply-To: <2bc9a79e-cc70-a4bb-9083-8007104105e2@2ndquadrant.com>
References: <dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com>
	<348f3158-bf7e-c5f0-f33b-9e552e3d5481@2ndquadrant.com>
	<266949.1610921277@sss.pgh.pa.us>
	<4b5a1272-b6ea-d2e0-9b8f-3bec20109eb5@2ndquadrant.com>
	<906053.1611249356@sss.pgh.pa.us>
	<7512e697-baad-4471-a3c0-93a0114ea07f@www.fastmail.com>
	<1154909.1611330153@sss.pgh.pa.us>
	<2bc9a79e-cc70-a4bb-9083-8007104105e2@2ndquadrant.com>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> I do wonder, however, under what circumstances code would be put into a 
> situation where it would add the exact same dependency again, and also 
> under what circumstances it would add a dependency between the same 
> objects but a different deptype, and how that would work during 
> recursive deletion.  Now that we have the refobjversion column, the 
> presence of duplicate dependencies might be even more dubious.  I think 
> that could be worth analyzing.

The duplicate-deps case occurs if, say, you use the same function more
than once in a view.  While we could probably get rid of dups generated
within the same recordMultipleDependencies call (and maybe already do?),
it's harder to deal with dups made by retail calls.  For example,
makeOperatorDependencies doesn't trouble to avoid making duplicate
dependencies when the operator's left and right input types are the
same, or the same as the result type.

The case with almost-dup-but-not-same-deptype *does* occur, for instance
it's very possible to have both normal and automatic dependencies.
As I recall, the policy is to perform the deletion if any of the deps
would allow it.

Dunno about refobjversion; I have my doubts that putting that info in
pg_depend was a sane design choice at all.  But from what I understand
of it, wouldn't all deps on a given object necessarily have the same
version?

			regards, tom lane





view thread (39+ messages)  latest in thread

Message-ID: <3714583.1612279054@sss.pgh.pa.us>
Permalink:  ../3714583.1612279054@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3714583.1612279054@sss.pgh.pa.us

 · 

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 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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, joel@compiler.org
  Subject: Re: Add primary keys to system catalogs
  In-Reply-To: <3714583.1612279054@sss.pgh.pa.us>
  References: <dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com> <348f3158-bf7e-c5f0-f33b-9e552e3d5481@2ndquadrant.com> <266949.1610921277@sss.pgh.pa.us> <4b5a1272-b6ea-d2e0-9b8f-3bec20109eb5@2ndquadrant.com> <906053.1611249356@sss.pgh.pa.us> <7512e697-baad-4471-a3c0-93a0114ea07f@www.fastmail.com> <1154909.1611330153@sss.pgh.pa.us> <2bc9a79e-cc70-a4bb-9083-8007104105e2@2ndquadrant.com> <3714583.1612279054@sss.pgh.pa.us>

* 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