Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYCwT-00ErXA-UR for pgsql-admin@arkaria.postgresql.org; Thu, 08 Feb 2024 22:32:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rYCwR-0041mV-QK for pgsql-admin@arkaria.postgresql.org; Thu, 08 Feb 2024 22:32:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYCwR-0041m9-FX for pgsql-admin@lists.postgresql.org; Thu, 08 Feb 2024 22:32:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYCwP-006CN6-8D for pgsql-admin@lists.postgresql.org; Thu, 08 Feb 2024 22:32:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 418MW4Eq1261631; Thu, 8 Feb 2024 17:32:04 -0500 From: Tom Lane To: Laurenz Albe cc: Ron Johnson , Pgsql-admin Subject: Re: DDL - TYPES In-reply-to: <8ab67ee36602a88a339182daff7cab4e585e13f3.camel@cybertec.at> References: <50cb348b4516c13d65cc2fc7220afd6573882b2f.camel@cybertec.at> <8ab67ee36602a88a339182daff7cab4e585e13f3.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Thu, 08 Feb 2024 23:21:19 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1261629.1707431524.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 08 Feb 2024 17:32:04 -0500 Message-ID: <1261630.1707431524@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe 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