From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Ron Johnson <ronljohnsonjr@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: DDL - TYPES
Date: Thu, 08 Feb 2024 17:32:04 -0500
Message-ID: <1261630.1707431524@sss.pgh.pa.us> (raw)
In-Reply-To: <8ab67ee36602a88a339182daff7cab4e585e13f3.camel@cybertec.at>
References: <CAHOGQfXpiHX0n8+MCRLamjixhk0FcyBNGr0cB5x73ZuW9pN_0w@mail.gmail.com>
<50cb348b4516c13d65cc2fc7220afd6573882b2f.camel@cybertec.at>
<CANzqJaAWDb2EPrrWpuPW4afq2V8oJ6GgGUZVkCSA=WSem-APcQ@mail.gmail.com>
<8ab67ee36602a88a339182daff7cab4e585e13f3.camel@cybertec.at>
Laurenz Albe <laurenz.albe@cybertec.at> writes:
>> They're never multi-line?
> Never, unless you create a type with a newline in its name:
> CREATE TYPE "my
> type" AS ENUM ('silly');
I think Ron was pointing out that the creation command as a whole
could run to multiple lines --- which is true, as a quick look
at the pg_dump source code will confirm. dumpEnumType for example
will put a newline after each enum value. So you'd need something
smarter than grep to extract a usable result.
One idea is to use pg_restore -l and then -L to extract a single
dump object from an archive dump.
regards, tom lane
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: DDL - TYPES
In-Reply-To: <1261630.1707431524@sss.pgh.pa.us>
* 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