public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrew Dunstan <[email protected]>
To: David G. Johnston <[email protected]>
To: Japin Li <[email protected]>
Cc: Zsolt Parragi <[email protected]>
Cc: Euler Taveira <[email protected]>
Cc: Álvaro Herrera <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: pg_get__*_ddl consolidation
Date: Sun, 5 Apr 2026 11:06:09 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<CAN4CZFNYM5jNA_gLu9miAXg_7c8Z2zf-ePc+0rzidAV3CBs=cw@mail.gmail.com>
	<[email protected]>
	<SY7PR01MB10921A6E1E08A48F3426FE529B651A@SY7PR01MB10921.ausprd01.prod.outlook.com>
	<CAKFQuwYcppypeGBwa7ZbDAfoUXSv+kLhJuAXsdwBmKrvy8wDFw@mail.gmail.com>
	<[email protected]>


On 2026-04-02 Th 12:27 PM, Andrew Dunstan wrote:
>
>
> On 2026-04-02 Th 9:35 AM, David G. Johnston wrote:
>> On Thursday, April 2, 2026, Japin Li <[email protected]> wrote:
>>
>>
>>     v3-0004
>>     ========
>>
>>     1.
>>     +       append_ddl_option(&buf, pretty, 4, "WITH TEMPLATE =
>>     template0");
>>
>>     I'm curious why WITH TEMPLATE = template0 is hardcoded. For example:
>>
>>       [local]:1374846 postgres=# create database db01 IS_TEMPLATE true;
>>       CREATE DATABASE
>>       [local]:1374846 postgres=# create database db02 template db01;
>>       CREATE DATABASE
>>       [local]:1374846 postgres=# select pg_get_database_ddl('db02');
>>      pg_get_database_ddl
>>      
>>     -----------------------------------------------------------------------------------------------------------------
>>        CREATE DATABASE db02 WITH TEMPLATE = template0 ENCODING =
>>     'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.UTF-8';
>>        ALTER DATABASE db02 OWNER TO japin;
>>       (2 rows)
>>
>>     Is this working as expected?
>>
>>     It seems there's no way to reconstruct the WITH TEMPLATE clause,
>>     right?
>>     A comment here would help.
>>
>>
>> There is no way or use in constructing the original template clause, 
>> though I agree it’s worth a comment.  At the end of the day the 
>> catalog data that was found in the db01 database already exists in 
>> the db02 database when executing these DLL reconstruction functions 
>> against the existing db02 database.  Taking nothing from the template 
>> is the correct behavior - hence template0.
>>
>>
>
>
> OK, here's a v4.
>
>
>

Pushed. I have moved the remaining get_*_ddl items to PG20-1


cheers


andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com


view thread (31+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: pg_get__*_ddl consolidation
  In-Reply-To: <[email protected]>

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

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox