Re: [SQL] Migration from db2 to postgres'

2003-08-19 Thread Tim Andersen
> I wanted to know how can I migrate all my data > including the schema and their definitions,from > IBM's db2 to the postgres. > I have done this with other DBMSs before by writing a program (using PowerBuilder). The core concept is this: two ODBC datasources (source, target) for (loop throug

Re: [SQL] About primary keys -- made some progress

2003-08-15 Thread Tim Andersen
This might not be the cleanest solution, but it runs fast and it retrieved the information I need. I broke it down into pieces and created several views to query from to simplify it for myself. The first four statements are views and the last one is the query I was originally trying to get. (note

Re: [SQL] About primary keys.

2003-08-15 Thread Tim Andersen
I looked in the info.c on line 2891 of the psqlodbc-7.2.5 to find this SQL logic (courtesy of Tom Lane) select ta.attname, ia.attnum from pg_attribute ta, pg_attribute ia, pg_class c, pg_index i, pg_namespace n where c.oid = i.indrelid AND n.oid = c.relnamespace AND i.indisprimary = 't' AND ia

Re: [SQL] About primary keys.

2003-08-15 Thread Tim Andersen
I'm new to PostgreSQL but I am familiar with DB2, Oracle and Sybase. I must say, I am impressed with PostgreSQL so far! In order to compare databases across DBMS platforms, we need to create a view that queries from the system catalog tables. This view returns all of the columns in the database