Re: [PATCH] Add pg_get_type_ddl() to retrieve the CREATE TYPE statement - Mailing list pgsql-hackers

From Philip Alger
Subject Re: [PATCH] Add pg_get_type_ddl() to retrieve the CREATE TYPE statement
Date
Msg-id CAPXBC8JxucG=m=Pnjb7-dLf5iqxcfA92-8UOEaNY1qDPH9dW3Q@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add pg_get_type_ddl() to retrieve the CREATE TYPE statement  (Quan Zongliang <quanzongliang@yeah.net>)
Responses Re: [PATCH] Add pg_get_type_ddl() to retrieve the CREATE TYPE statement
List pgsql-hackers
Hi Quan, 

This is part of a larger project as noted here:

> I am submitting a patch as part of the Retail DDL functions project
> described here [1]. 
 
> 1. https://www.postgresql.org/message-id/945db7c5-be75-45bf-b55b-
> cb1e56f2e3e9%40dunslane.net <https://www.postgresql.org/message-
> id/945db7c5-be75-45bf-b55b-cb1e56f2e3e9%40dunslane.net>

The idea here is to look up the created TYPE by its name and not the OID. The function that is close is pg_get_viewdef(text) [1], but that's deprecated.
 Also, see threads for: 

A. pg_get_trigger_ddl [2]
B. pg_get_tablespace_ddl [3]
C. pg_get_role_ddl [4]
D. pg_get_policy_ddl [5]
E. pg_get_domain_ddl [6]


--
Best, 
Phil Alger

pgsql-hackers by date:

Previous
From: Quan Zongliang
Date:
Subject: Re: [PATCH] Add pg_get_type_ddl() to retrieve the CREATE TYPE statement
Next
From: Peter Smith
Date:
Subject: Re: Logical Replication of sequences