public inbox for [email protected]  
help / color / mirror / Atom feed
From: Neil Chen <[email protected]>
To: Florin Irion <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement
Date: Thu, 20 Nov 2025 17:44:07 +0800
Message-ID: <CAA3qoJkyF2_jcCQ9ghk-Zps7bsfeBCcV0dYi1prqTZ=i26Yw6w@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAPgqM1V4LW2qiDLPsusb7s0kYbSDJjH5Tt+-ZzVmPU7xV0TJNQ@mail.gmail.com>
	<CACJufxE_8DveuvpiSnnRpeRGC9UdGY6X7ZptNt08-x+v-_5QQg@mail.gmail.com>
	<CAPgqM1URzR017U5gEK6S5dYz8VdYMaJf82G9sZFq5xbpHR1J_g@mail.gmail.com>
	<[email protected]>
	<CAPgqM1XBMQGP=w2a9jajGkrGMzVk0rGBm0+F1pnwsZnn_U6YoQ@mail.gmail.com>
	<CANxoLDeXxHgZXcO1HAimT0KkZm19wjLvNXct+sq7Lg+aBFKG3w@mail.gmail.com>
	<CAPgqM1XwWz3SWnkBwy+RSZ-XEPq7i=Hb52AA2-b5qXdEg9XNQA@mail.gmail.com>
	<[email protected]>

Hi Florin,

+pg_get_domain_ddl_ext(PG_FUNCTION_ARGS)
> +{
> + Oid domain_oid = PG_GETARG_OID(0);
> + bool pretty = PG_GETARG_BOOL(1);
> + char   *res;
> + int prettyFlags;
> +
> + prettyFlags = pretty ? GET_PRETTY_FLAGS(pretty) : 0;


Seems like we should directly use GET_PRETTY_FLAGS here, as it already
checks the value of "pretty". For a "display-oriented" result, using
PRETTYFLAG_INDENT looks more appropriate.

+ appendStringInfo(buf, "CREATE DOMAIN %s AS %s",
> + generate_qualified_type_name(typForm->oid),
> + generate_qualified_type_name(typForm->typbasetype));


It might be good to first call get_typtype to check if it is TYPTYPE_DOMAIN.


view thread (18+ 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]
  Subject: Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement
  In-Reply-To: <CAA3qoJkyF2_jcCQ9ghk-Zps7bsfeBCcV0dYi1prqTZ=i26Yw6w@mail.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox