Re: DDL - TYPES

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: DDL - TYPES
Date: 2024-02-08 22:32:04
Message-ID: 1261630.1707431524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2024-02-08 23:10:38 Re: pg_basebackup --wal-method=fetch
Previous Message Stephen Frost 2024-02-08 22:21:29 Re: pg_basebackup --wal-method=fetch