pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedlog level of "drop cascade" lists
4+ messages / 3 participants
[nested] [flat]
* log level of "drop cascade" lists
@ 2019-01-10 11:28 Willy-Bas Loos <willybas@gmail.com>
2019-01-10 15:44 ` Re: log level of "drop cascade" lists Adrian Klaver <adrian.klaver@aklaver.com>
2019-01-10 16:04 ` Re: log level of "drop cascade" lists Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 4+ messages in thread
From: Willy-Bas Loos @ 2019-01-10 11:28 UTC (permalink / raw)
To: pgsql-general
Hi,
(this is in version 9.4)
The SQL command DROP schema myschema CASCADE tells me that the full list of
items that the drop cascades to is in the log, but it isn't.
messages on stdout:
...
drop cascades to table myschema.mytable
and 143 other objects (see server log for list)
DROP SCHEMA
The log doesn't mention this at all, except
2019-01-10 12:10:45 CET ERROR: canceling autovacuum task
2019-01-10 12:10:45 CET CONTEXT: automatic analyze of table
"myschema.mytable"
log_min_messages is on the default value, which is warning.
#log_min_messages = warning
At first glance, it seems logical that the list of dropped items is a
"notice". But now that it seems that the cascade went further than i
anticipated, it is of a greater significance to me than that.
Also, truncating the list in the message and referring to the log is not
desirable IMHO if the default setting is to not log the list.
So long story short: i think it would be wise to set the log level of "drop
cascade" lists to "warning".
Cheers,
--
Willy-Bas Loos
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: log level of "drop cascade" lists
2019-01-10 11:28 log level of "drop cascade" lists Willy-Bas Loos <willybas@gmail.com>
@ 2019-01-10 15:44 ` Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 0 replies; 4+ messages in thread
From: Adrian Klaver @ 2019-01-10 15:44 UTC (permalink / raw)
To: Willy-Bas Loos <willybas@gmail.com>; pgsql-general
On 1/10/19 3:28 AM, Willy-Bas Loos wrote:
> Hi,
>
> (this is in version 9.4)
> The SQL command DROP schema myschema CASCADE tells me that the full list
> of items that the drop cascades to is in the log, but it isn't.
>
> messages on stdout:
> ...
> drop cascades to table myschema.mytable
> and 143 other objects (see server log for list)
> DROP SCHEMA
>
> The log doesn't mention this at all, except
> 2019-01-10 12:10:45 CET ERROR: canceling autovacuum task
> 2019-01-10 12:10:45 CET CONTEXT: automatic analyze of table
> "myschema.mytable"
>
> log_min_messages is on the default value, which is warning.
> #log_min_messages = warning
>
> At first glance, it seems logical that the list of dropped items is a
> "notice". But now that it seems that the cascade went further than i
> anticipated, it is of a greater significance to me than that.
Hence:
1) BEGIN;
DROP schema myschema CASCADE;
ROLLBACK/COMMIT;
2) \d myschema.*
> Also, truncating the list in the message and referring to the log is not
> desirable IMHO if the default setting is to not log the list.
>
> So long story short: i think it would be wise to set the log level of
> "drop cascade" lists to "warning".
>
> Cheers,
> --
> Willy-Bas Loos
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: log level of "drop cascade" lists
2019-01-10 11:28 log level of "drop cascade" lists Willy-Bas Loos <willybas@gmail.com>
@ 2019-01-10 16:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-01-11 12:50 ` Re: log level of "drop cascade" lists Willy-Bas Loos <willybas@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: Tom Lane @ 2019-01-10 16:04 UTC (permalink / raw)
To: Willy-Bas Loos <willybas@gmail.com>; +Cc: pgsql-general
Willy-Bas Loos <willybas@gmail.com> writes:
> So long story short: i think it would be wise to set the log level of "drop
> cascade" lists to "warning".
I think that would be met with more complaints than kudos.
"WARNING" is supposed to mean "there's probably something wrong here",
and a report of a cascaded drop is not that.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: log level of "drop cascade" lists
2019-01-10 11:28 log level of "drop cascade" lists Willy-Bas Loos <willybas@gmail.com>
2019-01-10 16:04 ` Re: log level of "drop cascade" lists Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-01-11 12:50 ` Willy-Bas Loos <willybas@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Willy-Bas Loos @ 2019-01-11 12:50 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general
On Thu, Jan 10, 2019 at 4:44 PM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
>
> 1) BEGIN;
> DROP schema myschema CASCADE;
> ROLLBACK/COMMIT;
>
> 2) \d myschema.*
On Thu, Jan 10, 2019 at 5:04 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I think that would be met with more complaints than kudos.
> "WARNING" is supposed to mean "there's probably something wrong here",
> and a report of a cascaded drop is not that.
>
OK, both are good points.
Since the list is truncated and possibly affects objects in other schemas,
I would recommend setting
SET log_min_messages = notice;
for that session (for anyone else reading this, no need to set it in the
settings file, the above is an sql command).
And then it is possible to view the full list in the log (e.g. after
rolling back the transaction with the drop query).
Cheers,
--
Willy-Bas Loos
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-01-11 12:50 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 11:28 log level of "drop cascade" lists Willy-Bas Loos <willybas@gmail.com>
2019-01-10 15:44 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-01-10 16:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-01-11 12:50 ` Willy-Bas Loos <willybas@gmail.com>
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