Re: creating a table based on a table in stored in another database

From: Scott Mead <scott(dot)lists(at)enterprisedb(dot)com>
To: Malm Paul <paul(dot)malm(at)saabgroup(dot)com>
Cc: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, AI Rumman <rummandba(at)gmail(dot)com>
Subject: Re: creating a table based on a table in stored in another database
Date: 2010-05-18 13:42:15
Message-ID: AANLkTilJP76RDQCxZH6xr7fLG1-Agr0iAlrpgTMdG7a_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 18, 2010 at 4:45 AM, Malm Paul <paul(dot)malm(at)saabgroup(dot)com> wrote:

> I can add that I would like to do this in my java application.
> E.i. just create an empty table in database1 which has the same column
> names and types as a table stored in database2.
>
> I tried this for a start:
> stmnt = dbConnection.prepareStatement("select dblink_connect('myconn',
> 'dbname=gemaps')");
> resultset = stmnt.executeQuery();
>
> but got ERROR: function dblink_connect(unknown, unknown) does not exist
>
>
Do you:

A) Install the dblink contrib module?
B) Run the dblink SQL file?

--Scott

/P
> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:
> pgsql-general-owner(at)postgresql(dot)org] On Behalf Of A. Kretschmer
> Sent: den 18 maj 2010 10:16
> To: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] creating a table based on a table in stored in
> another database
>
> In response to Malm Paul :
> > Hi list,
> > in a database I have different kind of tables. I would like to take the
> meta data from one of those tables and create the same type of table (but
> empty) in another database.
> > Can anyone, please, tell me how to do this?
>
> Create a schema-only dump and restore it into the other database.
>
>
> Regards, Andreas
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make
> changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Wong 2010-05-18 13:57:24 PDXPUG Day at OSCON 2010
Previous Message Tom Lane 2010-05-18 12:38:49 Re: Workqueue performance