Re: DDL - TYPES

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Gambhir Singh <gambhir(dot)singh05(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: DDL - TYPES
Date: 2024-02-08 20:02:26
Message-ID: 50cb348b4516c13d65cc2fc7220afd6573882b2f.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2024-02-09 at 00:44 +0530, Gambhir Singh wrote:
> I was trying to generate DDL of functions and procedures and generated it successfully
> using the below query.
>
> [...] SELECT pg_get_functiondef(f.oid) [...]
>
> When I tried to execute the generated DDL on other DB, I am getting the below error.
>
> 2024_02_07_IntegrationObjects_D0:3495: ERROR: type "xxxxxxxx" does not exist
>
> I am trying to find a way to generate the DDL of the TYPE, but have not been successful.

The canonical way is

pg_dump --section=pre-data yourdbname | grep 'CREATE TYPE .*\.xxxxxxxx'

Yours,
Laurenz Albe

In response to

  • DDL - TYPES at 2024-02-08 19:14:23 from Gambhir Singh

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2024-02-08 21:03:38 Re: DDL - TYPES
Previous Message Gambhir Singh 2024-02-08 19:14:23 DDL - TYPES