Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement

Japin Li <japinli@hotmail.com>

From: Japin Li <japinli@hotmail.com>
To: Florin Irion <irionr@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Álvaro Herrera <alvherre@kurilemu.de>, Haritabh Gupta <haritabh1992@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2026-03-12T01:20:09Z
Lists: pgsql-hackers
Hi, Florin

On Tue, 10 Mar 2026 at 16:01, Florin Irion <irionr@gmail.com> wrote:
> Hello,
>
> v10 rebased on latest master attached.
>

Thanks for updating the patch. When I reviewed [1], I noticed that
pg_get_database_ddl() uses spaces for indentation instead of tabs.
What do you think?

1.
+    /* Add valid constraints */
+    foreach(lc, validConstraints)
+    {
+        Oid         constraintOid = lfirst_oid(lc);

IMO, I think we can replace foreach() with foreach_oid().

2.
+    foreach(lc, invalidConstraints)
+    {
+        Oid         constraintOid = lfirst_oid(lc);

Same as above.

[1] https://www.postgresql.org/message-id/CANxoLDc6FHBYJvcgOnZyS%2BjF0NUo3Lq_83-rttBuJgs9id_UDg%40mail.gmail.com

> Cheers,
> Florin
>
>
> www.enterprisedb.com
>
> [2. text/plain; v10-0001-Add-pg_get_domain_ddl-function-to-reconstruct-CR.patch]...

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.