Fixed the documentation. v19 patch is now ready for review.
I didn't understand when a word is considered reserved, so that it has double quotes.
postgres=# create table int(int4 integer primary key, integer integer, interval interval, boolean boolean, insert boolean); CREATE TABLE
postgres=# select pg_get_table_ddl('int'::regclass, schema_qualified=>false, owner=>true, only_kinds => ARRAY['primary_key','check','table']);
pg_get_table_ddl
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE "int" (int4 integer NOT NULL, "integer" integer, "interval" interval, "boolean" boolean, insert boolean);
ALTER TABLE "int" OWNER TO postgres;
ALTER TABLE "int" ADD CONSTRAINT int_pkey PRIMARY KEY (int4);
(3 rows)
And as for the owner, I think that causes a bit of confusion when used with kinds parameters, doesn't it ?
It emits other ALTER TABLE except the OWNER TO.
postgres=# create table self(id integer primary key, self_id integer constraint self_self references self(id));
CREATE TABLE
postgres=# select pg_get_table_ddl('self'::regclass, owner=>true, except_kinds => ARRAY['table']);
pg_get_table_ddl
--------------------------------------------------------------------------------------------------
ALTER TABLE public.self ADD CONSTRAINT self_pkey PRIMARY KEY (id);
ALTER TABLE public.self ADD CONSTRAINT self_self FOREIGN KEY (self_id) REFERENCES public.self(id);
(2 rows)
regards
Marcos