pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
To: solai v <solai.cdac@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Add pg_get_publication_ddl function
Date: Tue, 09 Jun 2026 13:35:33 +0200
Message-ID: <87wlw83q0q.fsf@gmail.com> (raw)
In-Reply-To: <CAF0whuf9tQKQLz6VzDRVW6q2xLLoxuZf5ka2cSg4SkXJ3Xfd5w@mail.gmail.com>
References: <70d20c14d1c14f93e4200c1a9327b97d7c18a782.camel@gmail.com>
	<defc1876a11710f61228835471c0cdf402167314.camel@gmail.com>
	<CAF0whuf9tQKQLz6VzDRVW6q2xLLoxuZf5ka2cSg4SkXJ3Xfd5w@mail.gmail.com>

solai v <solai.cdac@gmail.com> writes:

Hello,

>
> [...] One thing I noticed is that the function currently returns
> SETOF text, producing multiple DDL statements such as CREATE
> PUBLICATION followed by ALTER PUBLICATION ... OWNER TO .... I wanted
> to check whether this is the intended long-term API design, as most
> existing pg_get_* functions return a single text value.

Yes this is by design, it's documented that they will return the
OWNER[1] unless that publications doesn't intend to have an OWNER in the
DDL.

> I also noticed
> that publication options are emitted as quoted values, for example:
>
> publish='insert, update'
> publish_generated_columns='none'
> publish_via_partition_root='false'
>
> Would it make sense to emit enum-like and boolean values in their
> native SQL form instead, such as:
>
> publish = 'insert, update'
> publish_generated_columns = none
> publish_via_partition_root = false

Yes, this was already handled by Peter Smith[1] email

Regards!

[1] https://www.postgresql.org/docs/19/functions-info.html#FUNCTIONS-GET-OBJECT-DDL 
[2] https://www.postgresql.org/message-id/CAHut%2BPvyd3vN_LV8ppyX6Vu7pKdBhC5M3_zHN7gdJCvz1%3DkKHQ%40mail... 

--
Jonathan Gonzalez V.
EDB
https://www.enterprisedb.com





view thread (22+ messages)  latest in thread

Message-ID: <87wlw83q0q.fsf@gmail.com>
Permalink:  ../87wlw83q0q.fsf@gmail.com/
Also on:    postgresql.org/message-id/87wlw83q0q.fsf@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: jonathan.abdiel@gmail.com, solai.cdac@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Add pg_get_publication_ddl function
  In-Reply-To: <87wlw83q0q.fsf@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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