Warnings "unrecognized node type" for some DDLs with log_statement = 'ddl'

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Warnings "unrecognized node type" for some DDLs with log_statement = 'ddl'
Date: 2017-09-14 03:54:19
Message-ID: CAB7nPqStC3HkE76Q1MnHsVd1vF1Td9zXApzYadzDMyLMRkkGrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

While reviewing another patch, I have bumped into a couple of failures
when running installcheck if log_statement = 'ddl'. This pops
regression failures for 4 tests: object_address, alter_generic,
alter_operator and stats_ext involving commands CREATE STATISTICS and
ALTER OPERATOR.

You can as well reproduce the failures using simply that:
=# create table aa (a int, b int);
CREATE TABLE
=# CREATE STATISTICS aa_stat ON a, b FROM aa;
WARNING: 01000: unrecognized node type: 332
LOCATION: GetCommandLogLevel, utility.c:3357
ERROR: 42P17: extended statistics require at least 2 columns
LOCATION: CreateStatistics, statscmds.c:220
=# ALTER OPERATOR = (boolean, boolean) SET (RESTRICT = NONE);
WARNING: 01000: unrecognized node type: 294
LOCATION: GetCommandLogLevel, utility.c:3357
ALTER OPERATOR

Attached is a patch to fix all the failures I have spotted. As CREATE
STATISTICS is new in PG10, I am adding an open item as things come
from 7b504eb2. The problems of ALTER OPERATOR are introduced by 9.6.
Still I would suggest to fix everything at the same time. The problem
comes from GetCommandLogLevel() which forgot to add T_CreateStatsStmt
and T_AlterOperatorStmt. I have noticed as well that
T_AlterCollationStmt was missing.

Thanks,
--
Michael

Attachment Content-Type Size
log-statement-ddl-fix.patch application/octet-stream 700 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hadi Moshayedi 2017-09-14 03:54:20 Re: [PATCH] Call RelationDropStorage() for broader range of object drops.
Previous Message Tom Lane 2017-09-14 03:39:21 Re: Is it time to kill support for very old servers?