Skip site navigation (1) Skip section navigation (2)

Tentative patch for making DROP put dependency info in DETAIL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-patches(at)postgreSQL(dot)org
Subject: Tentative patch for making DROP put dependency info in DETAIL
Date: 2008-06-10 01:43:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
There was some discussion a few days ago about making dependency.c emit
dependency reports in the same style that pg_shdepend.c does, viz
a lot of DETAIL lines on a single message instead of separate NOTICE
messages.  Attached is a tentative patch that does that.  See the
regression-test diffs for samples of what the output looks like.

I'm not entirely sure whether I like the results better than what
we have.  Opinions anyone?  There are some cases where it seems
clearly better, eg the sequence.out changes, but in a lot of others
it doesn't seem much better.

One particular case of interest is in truncate.out, where the
table-at-a-time implementation of DROP TABLE is clearly exposed
by the fact that you get multiple NOTICEs.  I wonder if it would
be worth refactoring the code so that a multiple-object DROP is
implemented via performMultipleDeletions().  This would have more
than just cosmetic advantages: it would no longer matter what
order you listed the tables in.  But the refactoring required looks
bigger and more tedious than I want to tackle right now.

I also want to note that we've historically had the code report
auto-cascade drops as DEBUG2 messages.  I tried to merge those reports
into the main one but it was a complete mess :-( because the client and
server-log messages might have different numbers of entries depending on
their log-level settings.  Almost the first case I tried favored me with
	NOTICE: drop cascades to 0 other object(s)
reported to the client (with the server log of course saying something
different).  So I gave up and left that behavior separate.

Comments?  Should we do this, or leave things alone?

			regards, tom lane

Attachment: dependency-notices-1.patch.gz
Description: application/octet-stream (4.6 KB)


pgsql-patches by date

Next:From: Tom LaneDate: 2008-06-10 02:01:24
Subject: Re: SQL: table function support
Previous:From: Neil ConwayDate: 2008-06-10 00:56:59
Subject: Re: SQL: table function support

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group