pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mladen Gogala <gogala.mladen@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Get the table creation DDL
Date: Sun, 10 Jul 2022 15:26:49 -0400
Message-ID: <ff439ee6-66f7-9b8d-d552-592e19547552@gmail.com> (raw)
In-Reply-To: <CA+FnnTwZVapcAFf=LsoW0ygLgVFf77rPxZjBCArqV7Q07NvY1g@mail.gmail.com>
References: <CA+FnnTw=ryKmxE696KoQ515Z5q1eb5wNr=OnhJv57+CTc9kKzQ@mail.gmail.com>
	<CAOzAquJOSJVya6Ap5-qGTemQ2f_NuN_Qtg1wM0=COSKhodHYoQ@mail.gmail.com>
	<CA+FnnTwZVapcAFf=LsoW0ygLgVFf77rPxZjBCArqV7Q07NvY1g@mail.gmail.com>

On 7/10/22 12:47, Igor Korot wrote:
> So there is no "query" per se?
> Also how do I pass the table name?
>
> Thank you.

You can create one from the catalog tables. Personally, I would use 
INFORMATION_SCHEMA to avoid pg_class and pg_attribute. However, there is 
an extension which does that for you. Somebody else has already done the 
hard work.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

view thread (24+ messages)  latest in thread

Message-ID: <ff439ee6-66f7-9b8d-d552-592e19547552@gmail.com>
Permalink:  ../ff439ee6-66f7-9b8d-d552-592e19547552@gmail.com/
Also on:    postgresql.org/message-id/ff439ee6-66f7-9b8d-d552-592e19547552@gmail.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: gogala.mladen@gmail.com
  Subject: Re: Get the table creation DDL
  In-Reply-To: <ff439ee6-66f7-9b8d-d552-592e19547552@gmail.com>
  References: <CA+FnnTw=ryKmxE696KoQ515Z5q1eb5wNr=OnhJv57+CTc9kKzQ@mail.gmail.com> <CAOzAquJOSJVya6Ap5-qGTemQ2f_NuN_Qtg1wM0=COSKhodHYoQ@mail.gmail.com> <CA+FnnTwZVapcAFf=LsoW0ygLgVFf77rPxZjBCArqV7Q07NvY1g@mail.gmail.com> <ff439ee6-66f7-9b8d-d552-592e19547552@gmail.com>

* 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