pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: Sengottaiyan T <techsenko@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: DB migration : Sybase to Postgres
Date: Thu, 25 May 2023 23:22:10 -0500
Message-ID: <94cb76a5-f18c-0a1e-cff7-fef61d5769e4@gmail.com> (raw)
In-Reply-To: <CADjQTvKMYqG4WerNQ102AWnT48JWQOAvuUzZsGd1uzkNbQ5POw@mail.gmail.com>
References: <CADjQTvLn=cD+Ry-uP0UkTMVoUFMpZts3_YtWib_baDm8UTSS3g@mail.gmail.com>
	<CADjQTvJbqia9EhhLpbsqH1tsZpNjTunDtjKKT5uTKJ=Q51tj6w@mail.gmail.com>
	<b39feec8-5a0b-9b8a-2835-86aba1032759@gmail.com>
	<CADjQTvKMYqG4WerNQ102AWnT48JWQOAvuUzZsGd1uzkNbQ5POw@mail.gmail.com>

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) 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 <ronljohnsonjr@gmail.com> wrote:
>
>     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, Sengottaiyan T wrote:
>>     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 respective team). After creating proper
>>     structure on target, the next step is to load data - I'm sure there
>>     will be a lot of errors during initial data load (no parent record
>>     found). How to handle it?
>>
>>     On Tue, Mar 28, 2023 at 3:22 PM Sengottaiyan T <techsenko@gmail.com>
>>     wrote:
>>
>>         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
>>
>
>     -- 
>     Born in Arizona, moved to Babylonia.
>

-- 
Born in Arizona, moved to Babylonia.

view thread (8+ messages)  latest in thread

Message-ID: <94cb76a5-f18c-0a1e-cff7-fef61d5769e4@gmail.com>
Permalink:  ../94cb76a5-f18c-0a1e-cff7-fef61d5769e4@gmail.com/
Also on:    postgresql.org/message-id/94cb76a5-f18c-0a1e-cff7-fef61d5769e4@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com, techsenko@gmail.com
  Subject: Re: DB migration : Sybase to Postgres
  In-Reply-To: <94cb76a5-f18c-0a1e-cff7-fef61d5769e4@gmail.com>
  References: <CADjQTvLn=cD+Ry-uP0UkTMVoUFMpZts3_YtWib_baDm8UTSS3g@mail.gmail.com> <CADjQTvJbqia9EhhLpbsqH1tsZpNjTunDtjKKT5uTKJ=Q51tj6w@mail.gmail.com> <b39feec8-5a0b-9b8a-2835-86aba1032759@gmail.com> <CADjQTvKMYqG4WerNQ102AWnT48JWQOAvuUzZsGd1uzkNbQ5POw@mail.gmail.com> <94cb76a5-f18c-0a1e-cff7-fef61d5769e4@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox