pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how to refer to tables in another database( or schema as oracle refers to)
5+ messages / 5 participants
[nested] [flat]

* how to refer to tables in another database( or schema as oracle refers to)
@ 2002-08-19 21:52 Jiaqing <jjw72@swbell.net>
  2002-08-20 01:35 ` Re: how to refer to tables in another database( or schema as oracle refers to) Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  2002-08-20 02:56 ` Re: how to refer to tables in another database( or schema as Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Jiaqing @ 2002-08-19 21:52 UTC (permalink / raw)
  To: pgsql-sql

Hello,
I'm still new here and new to PostgreSQL, I'd like to know that after I 
have created two databases on my site, such as one is called backend, and 
another one is called admin, how do I refer(query) the table from backend 
while I'm connected to admin database, or is it possible to do that in 
PostgreSQL? any answer is appreciated.

JJW.
8/19/2002




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: how to refer to tables in another database( or schema as oracle refers to)
  2002-08-19 21:52 how to refer to tables in another database( or schema as oracle refers to) Jiaqing <jjw72@swbell.net>
@ 2002-08-20 01:35 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  2002-08-20 02:47   ` Re: how to refer to tables in another database( or schema as oracle refers to) Graeme Merrall <gbmerrall@aol.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Christopher Kings-Lynne @ 2002-08-20 01:35 UTC (permalink / raw)
  To: Jiaqing <jjw72@swbell.net>; pgsql-sql

Hi Jiaqing,

Basically - you can't.  There is a program in the contrib/dblink directory
that can help you though.

Regards,

Chris

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Jiaqing
> Sent: Tuesday, 20 August 2002 5:53 AM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] how to refer to tables in another database( or schema as
> oracle refers to)
>
>
> Hello,
> I'm still new here and new to PostgreSQL, I'd like to know that after I
> have created two databases on my site, such as one is called backend, and
> another one is called admin, how do I refer(query) the table from backend
> while I'm connected to admin database, or is it possible to do that in
> PostgreSQL? any answer is appreciated.
>
> JJW.
> 8/19/2002
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: how to refer to tables in another database( or schema as oracle refers to)
  2002-08-19 21:52 how to refer to tables in another database( or schema as oracle refers to) Jiaqing <jjw72@swbell.net>
  2002-08-20 01:35 ` Re: how to refer to tables in another database( or schema as oracle refers to) Christopher Kings-Lynne <chriskl@familyhealth.com.au>
@ 2002-08-20 02:47   ` Graeme Merrall <gbmerrall@aol.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Graeme Merrall @ 2002-08-20 02:47 UTC (permalink / raw)
  To: chriskl@familyhealth.com.au; Jiaqing <jjw72@swbell.net>; pgsql-sql


> Basically - you can't.  There is a program in the contrib/dblink directory
> that can help you though.
>

My take on this dblink program is to create SQL as a view.
For example coming from Oracle you might do "SELECT one, two, FROM foo.bar".
Convert that to a VIEW called simply "bar" or "foo_bar" that contains your
dblink query and there will be minimal chnages you'll have to make to your
actual code.
This could also be used to get around synonyms as well.

Cheers,
 Graeme




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: how to refer to tables in another database( or schema as
  2002-08-19 21:52 how to refer to tables in another database( or schema as oracle refers to) Jiaqing <jjw72@swbell.net>
@ 2002-08-20 02:56 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2002-08-25 21:45   ` Re: how to refer to tables in another database( or schema) Mark Stosberg <mark@summersault.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Stephan Szabo @ 2002-08-20 02:56 UTC (permalink / raw)
  To: Jiaqing <jjw72@swbell.net>; +Cc: pgsql-sql

On Mon, 19 Aug 2002, Jiaqing wrote:

> Hello,
> I'm still new here and new to PostgreSQL, I'd like to know that after I
> have created two databases on my site, such as one is called backend, and
> another one is called admin, how do I refer(query) the table from backend
> while I'm connected to admin database, or is it possible to do that in
> PostgreSQL? any answer is appreciated.

In addition to previous answers (dblink related), in 7.3 schemas will
be implemented and you may be able to use one database with two schemas
in which case normal sql should work.  This isn't out yet, so it's a
future concern.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: how to refer to tables in another database( or schema)
  2002-08-19 21:52 how to refer to tables in another database( or schema as oracle refers to) Jiaqing <jjw72@swbell.net>
  2002-08-20 02:56 ` Re: how to refer to tables in another database( or schema as Stephan Szabo <sszabo@megazone23.bigpanda.com>
@ 2002-08-25 21:45   ` Mark Stosberg <mark@summersault.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Mark Stosberg @ 2002-08-25 21:45 UTC (permalink / raw)
  To: Stephan Szabo <sszabo@megazone23.bigpanda.com>; +Cc: Jiaqing <jjw72@swbell.net>; pgsql-sql

On Mon, 19 Aug 2002, Stephan Szabo wrote:

> On Mon, 19 Aug 2002, Jiaqing wrote:
>
> > Hello,
> > I'm still new here and new to PostgreSQL, I'd like to know that after I
> > have created two databases on my site, such as one is called backend, and
> > another one is called admin, how do I refer(query) the table from backend
> > while I'm connected to admin database, or is it possible to do that in
> > PostgreSQL? any answer is appreciated.
>
> In addition to previous answers (dblink related), in 7.3 schemas will
> be implemented and you may be able to use one database with two schemas
> in which case normal sql should work.  This isn't out yet, so it's a
> future concern.

One problem space that I think either of these solutions might address
is the issue of having static "country code" and "state code" tables
reproduced on many databases throughout an installation. Would anyone
recommend either of these solutions, or another one, for addressing this
issue?

I'm not looking forward to the day when a new country appears,
and I have to find all the places I have country code lists to add it.
:)

  -mark

http://mark.stosberg.com/




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2002-08-25 21:45 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-19 21:52 how to refer to tables in another database( or schema as oracle refers to) Jiaqing <jjw72@swbell.net>
2002-08-20 01:35 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2002-08-20 02:47   ` Graeme Merrall <gbmerrall@aol.com>
2002-08-20 02:56 ` Re: how to refer to tables in another database( or schema as Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-08-25 21:45   ` Re: how to refer to tables in another database( or schema) Mark Stosberg <mark@summersault.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox