Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    16

    Arrow Unanswered: How to access a table from another database in postgresql

    i want to create a table which is getting the data from a table which resides on the another database.
    create table temp as (select * from temp1);

    temp1 table is in database: db1 and current database is:db0

    how to write that querry
    thank U
    :-)

  2. #2
    Join Date
    Dec 2002
    Posts
    65
    If you're asking how to query data from more than 1 database in 1 query, I don't think there is a way to do this with a standard install, however I believe it is possible if you use contrib/dblink . At least that's what people tell me, when I've asked that question, however I have not needed to use it yet.
    HTH

    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  3. #3
    Join Date
    May 2002
    Location
    Florida, USA
    Posts
    49
    Also, remember that with PostreSQL 7.3, you have SCHEMA (with private tablespaces) support. This means that one database can actually look like as many "virtual" databases as you want, to different users. For example, if your database has a schema for 'public' (the default schema), you can also create a schema for 'devgroup'. In effect, both groups could have their own complete database, identical in tablenames, etc... but with different data. Then, whichever user has the appropriate permission (such as the 'postgres' root user) can query across both schemas in one query.

  4. #4
    Join Date
    Mar 2003
    Posts
    16
    thank U

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •