Re: DB migration : Sybase to Postgres

2023-05-26 Thread Ron
On 5/26/23 08:38, Peter J. Holzer wrote: On 2023-05-25 08:10:42 -0500, Ron wrote: (You can create the FKs ahead of time, but use the NOT VALID clause; then, after data is loaded do ALTER TABLE ... VALIDATE CONSTRAINT.) I don't think this will work: | Normally, [ADD CONSTRAINT] will cause a sca

Re: DB migration : Sybase to Postgres

2023-05-26 Thread Peter J. Holzer
On 2023-05-25 08:10:42 -0500, Ron wrote: > (You can create the FKs ahead of time, but use the NOT VALID clause; then, > after data is loaded do ALTER TABLE ... VALIDATE CONSTRAINT.) I don't think this will work: | Normally, [ADD CONSTRAINT] will cause a scan of the table to verify | that all exis

Re: DB migration : Sybase to Postgres

2023-05-26 Thread Marcos Pegoraro
Em qui., 25 de mai. de 2023 às 08:30, Sengottaiyan T escreveu: > Is there an option to set novalidate constraints in postgres? In my source > Sybase DB, table structures are not defined properly (only primary keys > exist and no foreign key) - I'm making necessary changes on target Postgres > DB

Re: DB migration : Sybase to Postgres

2023-05-25 Thread Ron
I don't remember, to be honest.  ALTER TABLE ... VALIDATE CONSTRAINT was /really fast/, though. Having a supporting index (which Pg does /not/ automatically create) is vital, of course. On 5/25/23 23:16, Sengottaiyan T wrote: Thanks Ron. While enabling the constraint (valid constraint) afte

Re: DB migration : Sybase to Postgres

2023-05-25 Thread Sengottaiyan T
Thanks Ron. While enabling the constraint (valid constraint) after initial data import, will it scan all the table data or the validation will happen for new rows inserted after that point)? On Thu, May 25, 2023 at 6:40 PM Ron wrote: > If I read your email correctly, I see two options > - Apply

Re: DB migration : Sybase to Postgres

2023-05-25 Thread Ron
If I read your email correctly, I see two options - Apply FK constraints *after* initial data load. - Load parent data before child data (You can create the FKs ahead of time, but use the NOT VALID clause; then, after data is loaded do ALTER TABLE ... VALIDATE CONSTRAINT.) On 5/25/23 06:30, Se

Re: DB migration : Sybase to Postgres

2023-05-25 Thread Sengottaiyan T
Is there an option to set novalidate constraints in postgres? In my source Sybase DB, table structures are not defined properly (only primary keys exist and no foreign key) - I'm making necessary changes on target Postgres DB (created tables, identifying relationship between table columns with resp

DB migration : Sybase to Postgres

2023-03-28 Thread Sengottaiyan T
Team, Need some help regarding Open Source tools for DB migration (from SYBASE to PostgreSQL) with real time CDC. Along with this, is there any possibility to migrate other objects (like Triggers, Stored Procedures and Functions) to PostgreSQL? Thanks, Senko