473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to move data from 1 database to another?

I have 2 databases. I want to move data from table table1 in database db1 to
table2 in db2.

When I query 1 table from another database, I get a cross-database
references are not implemented.

server1% psql db1
emdata=# select * from db2.public.table1;
ERROR: Cross-database references are not implemented
What can I do to get the data into another database?

Thanks,
Thomas

__________________________________________________ _______________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.com/go/onm00200415ave/direct/01/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
1 10865
On Tue, 11 May 2004, Thomas LeBlanc wrote:
I have 2 databases. I want to move data from table table1 in database db1 to
table2 in db2.

When I query 1 table from another database, I get a cross-database
references are not implemented.

server1% psql db1
emdata=# select * from db2.public.table1;
ERROR: Cross-database references are not implemented
What can I do to get the data into another database?


You can usually use pg_dump to accomplish such tasks. It's not something
likely to be implemented any time soon now that schemas have been
implemented. If you have no great reason to have two seperate databases
versus two schemas, you may want to investigate using schemas in the
future.

For now, you can do something like:

pg_dump -d db1 -t table1 |psql db2

then psql and do

insert into table2 (select * from table1);

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Caesar | last post by:
Hi, I'm wondering if anyone here can point me in the right direction. My host does not provide php, and so I need to pull this data from another server that does support such scripting. Help?...
0
by: Chris Nighswonger | last post by:
------=_NextPart_000_0013_01C352C0.6B0A6E30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi All, Is it possible in MySQL to use UPDATE to update...
0
by: Matthew Adams | last post by:
Hey, guys. I was wondering if anyone knew how to get data from another program's window, such as image or text data, or maybe just get a screenshot of the window. I was also wondering what is the...
10
by: coffeesin | last post by:
Hi, I have a Table containing these fields: id-no, cold, cold ever, cold date,flu,flu ever and flu date. (The properties of id-no, cold,cold ever,flu,flu ever are set as Numbers.) What i want...
1
by: anjupt | last post by:
Hi, I have 2 listboxes with data fetched from database so for both the listboxes datasource is set .i tried to move data from one listbox to another listbox but Error"An unhandled exception of...
2
by: arial | last post by:
Hi all, I am learning sql server 2000/2005. Now, I need to move data from my one sql server 1 to another sql server 2. I have five tables and data schema is same on both the server. as...
2
by: thread | last post by:
Hi All i'm building a database in access and i want to restrict permissions. from the access i can just limit the posiblity to unhide an hidden table and in this way i can preventing the users...
5
by: trixb | last post by:
Hello all, Here is what I need to do and need help with: I have a table that is feeding a chart in a report in Access. If this table has more than 50 records, the graph gets messy, and this is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.