review: Deparsing DDL command strings

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Subject: review: Deparsing DDL command strings
Date: 2012-11-22 10:46:15
Message-ID: CAFj8pRA09B=rrifDbeCDTqRCKZwC6ZqDA1uSC22gmeGh-afvEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Dimitri

* patching (success)

pavel ~/src/postgresql $ patch -p1 < binBUNnKQVPBP
patching file src/backend/catalog/heap.c
patching file src/backend/commands/event_trigger.c
patching file src/backend/commands/extension.c
patching file src/backend/commands/sequence.c
patching file src/backend/commands/view.c
patching file src/backend/tcop/utility.c
patching file src/backend/utils/adt/Makefile
patching file src/backend/utils/adt/ddl_rewrite.c
patching file src/backend/utils/adt/ruleutils.c
patching file src/backend/utils/cache/evtcache.c
patching file src/bin/psql/describe.c
patching file src/include/catalog/heap.h
patching file src/include/catalog/pg_event_trigger.h
patching file src/include/commands/event_trigger.h
patching file src/include/commands/extension.h
patching file src/include/commands/sequence.h
patching file src/include/commands/view.h
patching file src/include/utils/builtins.h
patching file src/include/utils/evtcache.h
patching file src/pl/plpgsql/src/pl_comp.c
patching file src/pl/plpgsql/src/pl_exec.c
patching file src/pl/plpgsql/src/plpgsql.h
patching file src/test/regress/expected/event_trigger.out
patching file src/test/regress/sql/event_trigger.sql

* compilation (success)

All of PostgreSQL successfully made. Ready to install.

* regress tests (success)

All 133 tests passed.

* issues

** missing doc

** statements are not deparsd for ddl_command_start event

postgres=# create table fooa(a int, b int);
NOTICE: event: ddl_command_start, context: TOPLEVEL, tag: CREATE
TABLE, operation: CREATE, type: TABLE, schema: <NULL>, name: <NULL>
NOTICE: command: <NULL>
NOTICE: event: ddl_command_start, context: TOPLEVEL, tag: CREATE
TABLE, operation: CREATE, type: TABLE, schema: <NULL>, name: <NULL>
NOTICE: command: <NULL>
NOTICE: event: ddl_command_end, context: TOPLEVEL, tag: CREATE TABLE,
operation: CREATE, type: TABLE, schema: public, name: fooa
NOTICE: command: CREATE TABLE public.fooa (a pg_catalog.int4, b
pg_catalog.int4);

** CREATE FUNCTION is not supported

postgres=# create or replace function bubu(a int) returns int as
$$select $1$$ language sql;
NOTICE: event: ddl_command_start, context: TOPLEVEL, tag: CREATE
FUNCTION, operation: CREATE, type: FUNCTION, schema: <NULL>, name:
<NULL>
NOTICE: command: <NULL>
NOTICE: event: ddl_command_start, context: TOPLEVEL, tag: CREATE
FUNCTION, operation: CREATE, type: FUNCTION, schema: <NULL>, name:
<NULL>
NOTICE: command: <NULL>
CREATE FUNCTION

* some wrong in deparsing - doesn't support constraints

postgres=# alter table a add column bbbsss int check (bbbsss > 0);
NOTICE: event: ddl_command_start, context: TOPLEVEL, tag: ALTER
TABLE, operation: ALTER, type: TABLE, schema: <NULL>, name: <NULL>
NOTICE: command: <NULL>
NOTICE: event: ddl_command_end, context: TOPLEVEL, tag: ALTER TABLE,
operation: ALTER, type: TABLE, schema: public, name: a
NOTICE: command: ALTER TABLE public.a ADD COLUMN bbbsss pg_catalog.int4, ;
ALTER TABLE

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chen Huajun 2012-11-22 10:50:30 Re: fix ecpg core dump when there's a very long struct variable name in .pgc file
Previous Message Sebastien FLAESCH 2012-11-22 10:26:51 Re: Database object names and libpq in UTF-8 locale on Windows