public inbox for [email protected]  
help / color / mirror / Atom feed
From: Maxim Sobolevskiy <[email protected]>
To: Damien Clochard <[email protected]>
Cc: [email protected]
Subject: Re: Export the CREATE TABLE command in pure SQL
Date: Tue, 19 Mar 2019 11:51:04 +0300
Message-ID: <CAB65UsX=vjCYXBc7Q2t3aG6u2sH8iWZs7oZVJz1gwfrkny+42A@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

In DataGrip, which is java-application, we first get all attributes of the
object from the database, then Java-code generates the whole DDL based on
the attributes we have.

On Sun, Mar 17, 2019 at 11:49 AM Damien Clochard <[email protected]> wrote:

> hey guys,
>
> The most effective and simplest way to export the creation command of a
> table is to use `pg_dump --schema-only`
>
> However for one my projects, I don't have access to pg_dump and I need
> to extract the data with a SQL or pl/pgsql function. I already wrote a
> naïve implementation that handles primary keys and temporary tables. But
> I realize it's probably incomplete and I will have to maintain it for
> every new PostgreSQL major version....
>
> How do you guys deal with this ? It seems that a lot of GUI tools are
> able to "export the table structure".... Is there an extension somewhere
> to do that ? Is it possible to write i in pure SQL ? If yes, there
> anybody here interested in joining forces to build a shared export
> function ?
>
> Have nice day !
>
> --
> Damien Clochard
>
>

-- 
Max Sobolevskiy
Product Marketing Manager of DataGrip
JetBrains


view thread (8+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Export the CREATE TABLE command in pure SQL
  In-Reply-To: <CAB65UsX=vjCYXBc7Q2t3aG6u2sH8iWZs7oZVJz1gwfrkny+42A@mail.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox