On Thursday, April 2, 2026, Japin Li <japinli@hotmail.com> 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.