Adrian: That is an excellent idea and one I use all the time in my own tables. Unfortunately, I only have read access to the MSSql tables. What I plan to do is only pull records from the MSSql tables since the last time the import was done - with a little overlap to make sure I get all of the new records. Then I will only add new records to the PostgreSQL tables.
I would like to express an opinion regarding MSSql vs. PostgreSQL just in case someone might be interested. I created two databases based on an actual MSSql database that I will be pulling from in production. One in MSSql and one in PostgreSQL. Other than VFP I have done quite a bit of experience accessing MSSql but I had no experience with PostgreSQL. After a couple of days I feel I know PostgreSQL much better than the other. It is almost intuitive and very easy to work with (maybe from my VFP experience). Because it is open source it seems to be a *lot* easier to get questions answered. My analogy would be a Cadillac vs. a Miata. One has all of the bells and whistles and the other just plain works and is a lot more fun to drive. YMMV -- Jeff Jeff Johnson j...@dcsoftware.com Phoenix Python User Group - sunpigg...@googlegroups.com Adrian Klaver wrote: > On Saturday 12 September 2009 10:35:34 am Jeff Johnson wrote: >> John wrote: >>> On Saturday 12 September 2009 09:26:34 am Ed Leafe wrote: >>>> On Sep 11, 2009, at 9:03 PM, Jeff Johnson wrote: >>>>> I am using Dabo to access a MSSQL Server and a PostgreSQL Server. It >>>>> was pretty easy to get two connections going. PostgreSQL is my app >>>>> connection. Is it possible to do a select statement on a table from a >>>>> database in one connection and a table from a database in another >>>>> connection? >>>>> >>>>> Here is what I want to do: >>>>> >>>>> SELECT * from mstable ; >>>>> where not exists(select * from pgtable ; >>>>> where mstable.pk = pgtable.pk) >>>>> >>>>> The purpose is to find records in the MS table that don't exist in the >>>>> PG table so I can add them. > >> Thanks Ed & John! The tables are large but all have datetimes in them >> so I can select the most recent month, etc. The mssql tables don't have >> primary keys but do have a unique field. Ed's suggestions sounds very >> workable. >> >> Thanks, > > Do you have control of the MSSQL Server? If so would it be possible to add a > boolean sync field to the MSSQL table to indicate records that have been > synced > to the Postgres table. The first run through would be large but after that it > would a matter of select ... where synced='f'. _______________________________________________ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/4aabf1c6.4060...@dcsoftware.com