By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,672 Members | 1,289 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,672 IT Pros & Developers. It's quick & easy.

A simple question (under pressure :-))....

P: n/a
Guys,

I have approx. 8 hours to finish a deadline, so I can no longer spend time searching google...haven't found the answer yet.

In PG, is there not a way to select amongst databases?

In other words, if I have one schema called sch1 and another called sch2, and I'm connected to sch2, could I not do:

select fieldname from sch1.tablename

I'm running 7.2.3, so I think there was no such things as a schema in this release...just a database, but can't recall.

It seems I've been able to do this in the past, but I may be remembering wrong.

Thanks!
John

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
John Wells <jb@sourceillustrated.com> writes:
Guys,

I have approx. 8 hours to finish a deadline, so I can no longer spend time searching google...haven't found the answer yet.

In PG, is there not a way to select amongst databases?

In other words, if I have one schema called sch1 and another called sch2, and I'm connected to sch2, could I not do:

select fieldname from sch1.tablename

I'm running 7.2.3, so I think there was no such things as a schema in this release...just a database, but can't recall.
Right. Schemas went into 7.3. You can try 'contrib/dblink' for
cross-database queries in earlier versions--it might or might not work
for you (I've never used it myself).
It seems I've been able to do this in the past, but I may be
remembering wrong.


Maybe that was with 7.3 or 7.4?

-Doug

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2

P: n/a
Hi John,

Short answer: you can do cross-schema queries, you can't (easily) do
cross database queries.

Check out this:
http://www.postgresql.org/docs/7.4/static/ddl.html
, the schema section:
http://www.postgresql.org/docs/7.4/s...l-schemas.html

I'm not sure when schemas were introduced, but I suppose you want to use
the latest postgres version.

Cheers,
Csaba.

On Mon, 2004-03-01 at 02:37, John Wells wrote:
Guys,

I have approx. 8 hours to finish a deadline, so I can no longer spend time searching google...haven't found the answer yet.

In PG, is there not a way to select amongst databases?

In other words, if I have one schema called sch1 and another called sch2, and I'm connected to sch2, could I not do:

select fieldname from sch1.tablename

I'm running 7.2.3, so I think there was no such things as a schema in this release...just a database, but can't recall.

It seems I've been able to do this in the past, but I may be remembering wrong.

Thanks!
John

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3

P: n/a
Hi John,

Short answer: you can do cross-schema queries, you can't (easily) do
cross database queries.

Check out this:
http://www.postgresql.org/docs/7.4/static/ddl.html
, the schema section:
http://www.postgresql.org/docs/7.4/s...l-schemas.html

I'm not sure when schemas were introduced, but I suppose you want to use
the latest postgres version.

Cheers,
Csaba.

On Mon, 2004-03-01 at 02:37, John Wells wrote:
Guys,

I have approx. 8 hours to finish a deadline, so I can no longer spend time searching google...haven't found the answer yet.

In PG, is there not a way to select amongst databases?

In other words, if I have one schema called sch1 and another called sch2, and I'm connected to sch2, could I not do:

select fieldname from sch1.tablename

I'm running 7.2.3, so I think there was no such things as a schema in this release...just a database, but can't recall.

It seems I've been able to do this in the past, but I may be remembering wrong.

Thanks!
John

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.