pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date: Tue, 21 Jan 2014 19:28:51 -0300
Message-ID: <20140121222851.GL10723@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <CAEZATCVHBqeobQMop-AMuNp6XnaD6+mGK26O=2eL=-afevwytg@mail.gmail.com>
References: <CAEZATCVbjDhoTFbKY1+O_Rdt=gs=7GpKVUpKBbZKK0aZCW1agA@mail.gmail.com>
	<CAFj8pRBvpCoyaB3i3di9YPtuarJPgod51FPxjMei2n=82yzsAQ@mail.gmail.com>
	<CAEZATCVEZFCTkhr2k96cy5WDnq6B8iTh1tkVTZLdrw17Aedc4Q@mail.gmail.com>
	<CAFj8pRC=rJE8dg28+KMgG4eDunQVz8isV1GoqNqWA_cUkNdraQ@mail.gmail.com>
	<1386207187.13848.2.camel@vanquo.pezone.net>
	<CAEZATCVLAeRZoNCwS--00OnhSjCbtaP+viWyOMOFV69S4AnRYQ@mail.gmail.com>
	<CAFj8pRAgm6n35vZ5pJ0Nq=YoRNzmmyC-CD_EVkdhjBNwMA2zzw@mail.gmail.com>
	<CAEZATCX9idgfH5Z0Qi42WGivM9XCzk_3Ff9ND1wmU1wg6QC-Dg@mail.gmail.com>
	<CAFj8pRAG+y7PEVsbTmec4UZZSEQKMiU0BcT=wZTzGmLS-npDeA@mail.gmail.com>
	<CAEZATCVHBqeobQMop-AMuNp6XnaD6+mGK26O=2eL=-afevwytg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

I have been mulling over this patch, and I can't seem to come to terms
with it.  I first started making it look nicer here and there, thinking
it was all mostly okay, but eventually arrived at the idea that it seems
wrong to do what this does: basically, get_object_address() tries to
obtain an object address, and if that fails, return InvalidOid; then, in
RemoveObjects, we try rather hard to figure out why that failed, and
construct an error message.

It seems to me that it would make more sense to have get_object_address
somehow return a code indicating what failed; then we don't have to go
all over through the parser code once more.  Perhaps, for example, when
missing_ok is given as true to get_object_address it also needs to get a
pointer to ObjectType and a string; if some object does not exist then
fill the ObjectType with the failing object and the string with the
failing name.  Then RemoveObjects can construct a string more easily.
Not sure how workable this exact idea is; maybe there is a better way.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (83+ messages)  latest in thread

Message-ID: <20140121222851.GL10723@eldon.alvh.no-ip.org>
Permalink:  ../20140121222851.GL10723@eldon.alvh.no-ip.org/
Also on:    postgresql.org/message-id/20140121222851.GL10723@eldon.alvh.no-ip.org

 · 

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-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, dean.a.rasheed@gmail.com, pavel.stehule@gmail.com, peter_e@gmx.net, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
  In-Reply-To: <20140121222851.GL10723@eldon.alvh.no-ip.org>
  References: <CAEZATCVbjDhoTFbKY1+O_Rdt=gs=7GpKVUpKBbZKK0aZCW1agA@mail.gmail.com> <CAFj8pRBvpCoyaB3i3di9YPtuarJPgod51FPxjMei2n=82yzsAQ@mail.gmail.com> <CAEZATCVEZFCTkhr2k96cy5WDnq6B8iTh1tkVTZLdrw17Aedc4Q@mail.gmail.com> <CAFj8pRC=rJE8dg28+KMgG4eDunQVz8isV1GoqNqWA_cUkNdraQ@mail.gmail.com> <1386207187.13848.2.camel@vanquo.pezone.net> <CAEZATCVLAeRZoNCwS--00OnhSjCbtaP+viWyOMOFV69S4AnRYQ@mail.gmail.com> <CAFj8pRAgm6n35vZ5pJ0Nq=YoRNzmmyC-CD_EVkdhjBNwMA2zzw@mail.gmail.com> <CAEZATCX9idgfH5Z0Qi42WGivM9XCzk_3Ff9ND1wmU1wg6QC-Dg@mail.gmail.com> <CAFj8pRAG+y7PEVsbTmec4UZZSEQKMiU0BcT=wZTzGmLS-npDeA@mail.gmail.com> <CAEZATCVHBqeobQMop-AMuNp6XnaD6+mGK26O=2eL=-afevwytg@mail.gmail.com> <20140121222851.GL10723@eldon.alvh.no-ip.org>

* 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