Re: [SQL] Comparing two tables of different database

2009-05-02 Thread Lucas Brito
Nicholas, To use the dblink: 1. In your postgres server you should find a file *dblink.sql*. In my beta installation is in *share/postgresql/contrib*. It is the installation for the dblink contrib module that usually is already compiled in. It will create a lot of dblink functions.

[SQL] using a list to query

2009-05-02 Thread johnf
I have a list (or array) of primary keys stored in a field (data type text). I would like to use the list to retrieve all the data from a table based on the list. my text field contains: '123,134,343,345' I would to do something like the following: Select * from table1 where table1.pkid in

Fwd: [SQL] Comparing two tables of different database

2009-05-02 Thread Isaac Dover
i've not tried this in postgres, but using information_schema makes comparing structures of databases trivial. i've been using this query for a while with MSSQL. Maybe this helps to answer the question. - isaac select ST.Table_Name, ST.Column_Name, DV.Table_Name, DV.Column_Name, * from

Re: [SQL] Comparing two tables of different database

2009-05-02 Thread Lucas Brito
2009/5/2 Isaac Dover isaacdo...@gmail.com i've not tried this in postgres, but using information_schema makes comparing structures of databases trivial. i've been using this query for a while with MSSQL. Maybe this helps to answer the question. - isaac select ST.Table_Name, ST.Column_Name,

Re: [SQL] using a list to query

2009-05-02 Thread Craig Ringer
johnf wrote: I have a list (or array) of primary keys stored in a field (data type text). I would like to use the list to retrieve all the data from a table based on the list. my text field contains: '123,134,343,345' I would to do something like the following: Select * from

Re: [SQL] Comparing two tables of different database

2009-05-02 Thread Isaac Dover
Thank you, Lucas. I'm from the MS world, still learning these PG things. Though, it appears that the difference is somewhat minor. In my actual implementation, [other database] would be a linked server, which sounds like it would be similar to the PG dblink. Regardless, I've found information