Need create table statements from metadata

From: David Gauthier <davegauthierpg(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Need create table statements from metadata
Date: 2019-06-20 21:32:56
Message-ID: CAMBRECDGoMqTwpqG8xRyGc0rc0UpefMUCod4pw8he5umQDiwgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

psql (9.6.7, server 9.5.2) on linux.

I have 2 DBs, one for dev the other is live. I want to recreate several
tables in the dev db using the same metadata found in the live db. But I'm
too lazy to manually transcribe everything and that's prone to error anyway.

In the past, I would just run pg_dump and capture metadata only for
selected tables, then use that to (re)create that tables in the other DB.
But where I am now, they don't give me the privs to run pg_dump.

So I was wondering if there's a way to do this quickly and cleanly without
pg_dump. Perhaps a stored procedure that pg_dump uses (or something like
that) ?

Thanks in Advance !

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Gauthier 2019-06-20 21:43:38 List tables for a specific schema
Previous Message David G. Johnston 2019-06-20 21:16:50 Re: Odd Update Behaviour