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: 5032.1213062214@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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)
DETAIL:
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 Content-Type Size
dependency-notices-1.patch.gz application/octet-stream 4.6 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-06-10 02:01:24 Re: SQL: table function support
Previous Message Neil Conway 2008-06-10 00:56:59 Re: SQL: table function support