| From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> | 
|---|---|
| To: | David Gauthier <davegauthierpg(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Need create table statements from metadata | 
| Date: | 2019-06-20 22:25:45 | 
| Message-ID: | 2c3e0a27-7f27-33fa-c580-cca381aca77c@aklaver.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On 6/20/19 2:32 PM, David Gauthier wrote:
> 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) ?
To add to my previous post you can use third party tools:
1) SQL Workbench/J
http://www.sql-workbench.eu/
http://www.sql-workbench.eu/TableSource_png.html
2) pgAdmin
https://www.pgadmin.org/
https://www.pgadmin.org/docs/pgadmin4/4.x/table_dialog.html
> 
> Thanks in Advance !
-- 
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Miles Elam | 2019-06-20 22:30:38 | Re: Inserts restricted to a trigger | 
| Previous Message | Tom Lane | 2019-06-20 22:06:18 | Re: List tables for a specific schema |