Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q2Y2j-0001Vj-SW for pgsql-general@arkaria.postgresql.org; Fri, 26 May 2023 14:03:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2Y2h-0003m4-D8 for pgsql-general@arkaria.postgresql.org; Fri, 26 May 2023 14:03:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q2Y2h-0003lm-0W for pgsql-general@lists.postgresql.org; Fri, 26 May 2023 14:03:43 +0000 Received: from mail-yb1-xb30.google.com ([2607:f8b0:4864:20::b30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q2Y2d-002Hay-8G for pgsql-general@lists.postgresql.org; Fri, 26 May 2023 14:03:42 +0000 Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-ba82059ef0bso742090276.1 for ; Fri, 26 May 2023 07:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685109818; x=1687701818; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=XOIWeKlIdY3ENWVcKILQSPQP7bQ5fLXLiJn9viqjfTs=; b=o8HQKMjHtfphH0PwYFAt12ii+lDzc5QE4MYviLUpHaOSKTJYMz367eEgp82H9HJFkn wcHbKINRwnV+62V2uRgXVFHF+VOaIrIR34bC93oLmIJAjSc/Q4Iz18sgqG+QAHnEolrb X6SCSO7qRDt7onh2PVaxiPrffLIP6sMhnnQWbF92872vVYHS8MYPIJwHqWeIGoGS+mR+ APnneJTlB0eDMgHKq4VOyWz4HhkIys3cRMVyGJNJ3sLlE66mcuDSz7GZlRjaOQHhBaU2 0XRMclV4TCia3EHlZt+RiCVVRzq2P3XeOq+uuBq8ip7k2Xw2kFXDEVwLTOLlc2sbxJRx hZGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685109818; x=1687701818; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XOIWeKlIdY3ENWVcKILQSPQP7bQ5fLXLiJn9viqjfTs=; b=MvQKOQhSiZDmaPN4cDOURkRR/AyVrXuB6rwZtfaMRJ+pqybeEoK9PR0OTrqbTNAw2O 9BsoBM6TXGcVQejFiEF84nnJXNYHTvI+c0CY7r8ZNzXsJrCNXSGibSf+1CAZBmGCJbVC Mmwcnhh6CD4A1AXYs93/0BccMhRphJuMgcc0b7h52A6OMMRS80PK3ypFWporsepgMySq L3mrbBMrrDglqYOwaNScYGAoNAIl3c22Y6j1cZdgSx2fjDG0L8qRfh1MNgSH2TMMAp9K KUzrRjrt88Kjc7JWcuOYzjUB/T12oZeKm1Cfcgc99+GU3wMGILkp8MBdJezcXzewwK4A HGsA== X-Gm-Message-State: AC+VfDxHKYqBbOl4iABSscg6h3CZidsOPi0cDxuQeLZS5bR/ssMpL+XK 5OmXNJHim9wLn2D07xfC2BDzad3/s/I= X-Google-Smtp-Source: ACHHUZ5RHjwMVZpChE5Dil2oziU0/VkLvmvGeUwOp5PVm3pZgQ38mvW+Pr0KTaeBcZbl0Xl9OcQxhQ== X-Received: by 2002:a25:ae60:0:b0:ba6:f438:afeb with SMTP id g32-20020a25ae60000000b00ba6f438afebmr1857446ybe.13.1685109817716; Fri, 26 May 2023 07:03:37 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:5d38:fc4c:f78f:862b? ([2600:1700:bd2c:b810:5d38:fc4c:f78f:862b]) by smtp.googlemail.com with ESMTPSA id h6-20020a255306000000b00ba867a46d19sm1033071ybb.18.2023.05.26.07.03.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 May 2023 07:03:37 -0700 (PDT) Message-ID: <0b636573-472e-f129-c759-71a311b45fd6@gmail.com> Date: Fri, 26 May 2023 09:03:36 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: DB migration : Sybase to Postgres Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <20230526133851.ekpsb2l56jpx3bks@hjp.at> From: Ron In-Reply-To: <20230526133851.ekpsb2l56jpx3bks@hjp.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 scan of the table to verify > | that all existing rows in the table satisfy the new constraint. But if > | the NOT VALID option is used, this potentially-lengthy scan is > | skipped. The constraint will still be enforced against subsequent > | inserts or updates > (https://www.postgresql.org/docs/current/sql-altertable.html) I was probably thinking of tables with existing data. -- Born in Arizona, moved to Babylonia.