Thread: Accessing another db?
After browsing through the archives and coming up nix I was wondering if it's possoble for a user to query the tables in another database. Coming from an Oracle background it's possible to use "SELECT column1 FROM user.table" but I can't seem to find if this is possible in postgres I've read some discussion from April 2002 which infers that that functionality doesn't exist but it's coming in 7.3. Correct? Permissions aren't too much of a problem because this is in a private system. Cheers, Graeme
On Tue, Jun 18, 2002 at 03:57:20PM +1000, Graeme Merrall wrote: > After browsing through the archives and coming up nix I was wondering if > it's possoble for a user to query the tables in another database. Coming > from an Oracle background it's possible to use "SELECT column1 FROM > user.table" but I can't seem to find if this is possible in postgres > > I've read some discussion from April 2002 which infers that that > functionality doesn't exist but it's coming in 7.3. Correct? Postgres doesn't support queries from other databases and probably never will. What you're referring to is schemas. i.e. grouping tables into schemas and controlling access to each. This feature is under development and will probably appear in 7.3. -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > There are 10 kinds of people in the world, those that can do binary > arithmetic and those that can't.
On Tue, Jun 18, 2002 at 03:57:20PM +1000, Graeme Merrall wrote: > After browsing through the archives and coming up nix I was wondering if > it's possoble for a user to query the tables in another database. Coming > from an Oracle background it's possible to use "SELECT column1 FROM > user.table" but I can't seem to find if this is possible in postgres AFAIK every database has its own tables - and cannot see other databases tables. In pgsql You can change to another database with the command \connect <database_name> > I've read some discussion from April 2002 which infers that that > functionality doesn't exist but it's coming in 7.3. Correct? I don't know, sorry. greetz -tb -- Thomas Beutin tb@laokoon.IN-Berlin.DE Beam me up, Scotty. There is no intelligent live down in Redmond.
Try using the dblink commands. We were able to do remote updates and queries on three different databases on 3 remote locations. It works within our intranet connection. Manny