473,396 Members | 1,707 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,396 software developers and data experts.

access to database

Hello
I have 2 databases on PostgreSQL, for instance base1, base2.
I connect to psql: psql -p 3333 base1
how can I access to base2 ?
for instance I wont do instruction:

insert into test(a, b)
values
select a, b
from basa2.test

of course baza2.test isn't valid on PostgreSQL - how can I do it ?
how can I get access to another database ?

sorry for my poor english :)

greet
Robert (from Poland)
Jul 19 '05 #1
3 2581
RobertG wrote:
Hello
I have 2 databases on PostgreSQL, for instance base1, base2.
I connect to psql: psql -p 3333 base1
how can I access to base2 ?
for instance I wont do instruction:

insert into test(a, b)
values
select a, b
from basa2.test

of course baza2.test isn't valid on PostgreSQL - how can I do it ?
how can I get access to another database ?

sorry for my poor english :)

greet
Robert (from Poland)


I answered this from another news client which sometimes doesn't send
properly. So I'll answer again.

If I remember correctly (IIRC), you can't open 2 different dbases using
pgsl. You can do it by using perl DBI. I can help you do this if you
need help.

Boyd
Jul 19 '05 #2
On Tue, 10 Feb 2004 14:58:50 -0500, boyd (remove_) tb_moore_@bealenet_.com
wrote:
I answered this from another news client which sometimes doesn't send
properly. So I'll answer again.

If I remember correctly (IIRC), you can't open 2 different dbases using
pgsl. You can do it by using perl DBI. I can help you do this if you
need help.


I believe his other option would be to use two schemas rather than two
databases.

Cheers!

Greg

Jul 19 '05 #3
Hi Robert,

I've never able to log in to one database and query data from another
database in my sql queries.

But what will work is if you create one (1) database and put two distince
"schemas" in them. Read the PostgreSQL documentation about schemas. If
you went that route, you'd have one database, call it "myDB" for example.
Then, within myDB, you could create two schemas called "base1" and
"base2". If you had proper permissions on both schema's, then your query
would work. You'd have to modify your query to reference the proper
schemas with something like:

INSERT INTO base1.test(a,b)
VALUES (SELECT a, b
FROM base2.test
)

But other than using schema's like that, I don't know how to query data
from one database while logged in to another. If anyone else knows if/how
this can be done I'd love to learn.

Cheers,
w.k.
On Fri, 6 Feb 2004, RobertG wrote:
Hello
I have 2 databases on PostgreSQL, for instance base1, base2.
I connect to psql: psql -p 3333 base1
how can I access to base2 ?
for instance I wont do instruction:

insert into test(a, b)
values
select a, b
from basa2.test

of course baza2.test isn't valid on PostgreSQL - how can I do it ?
how can I get access to another database ?

sorry for my poor english :)

greet
Robert (from Poland)

Jul 19 '05 #4

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

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
11
by: Rosco | last post by:
Does anyone have a good URL or info whre Oracle and Access are compared to one another in performance, security, cost etc. Before you jump on me I know Oracle is a Cadillac compared to Access the...
64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
49
by: Mell via AccessMonster.com | last post by:
I created databases on Access 2003 and I want to deploy them to users. My code was also done using 2003. If they have Ms Access 2000 or higher, will they be able to use these dbs with all code,...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
34
by: Mathieu Trentesaux | last post by:
Hello I downloaded Office 2007 for this reason : It seems, once again, that it is impossible to save any modification done in a VBA library, from the main project in Access. The save button...
21
by: nihad.nasim | last post by:
Hi there, I have a database in Access that I need on the web. The web page should connect to the database and write records for certain tables and view records for others. I want to know a...
11
by: Harel | last post by:
I have a report SQL which have been working for a few weeks. Its large and the target database is large. It has 59 join, and I dont think there is anything I can do about this, since the DB I use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.