Re: save to another database - Mailing list pgsql-novice

From A. Kretschmer
Subject Re: save to another database
Date
Msg-id 20060120061959.GB18233@webserv.wug-glas.de
Whole thread Raw
In response to save to another database  (First Last <y2kdis@atenista.net>)
List pgsql-novice
am  19.01.2006, um 22:07:38 -0800 mailte First Last folgendes:

Good morning, First Last,

> how do i save the result of a query into a new table in another database? the IN database doesn't seem to work for in
postgresql;
> "SELECT * INTO newtable IN newdatabase FROM mytable";

Impossible.

Solutions:

- use dblink from contrib
  http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/dblink/
  http://pgfoundry.org/projects/dblink-tds/

- save the result in a table, create a dump from this table with
  pg_dump, open the other database, restore the dump.
  You can do this steps in a shell-script.


HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

pgsql-novice by date:

Previous
From: First Last
Date:
Subject: save to another database
Next
From: Agnes Bocchino
Date:
Subject: Initdb panic: invalid record offset at 0/0 creating template1