Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfivZ-00CsGp-0b for pgsql-general@arkaria.postgresql.org; Mon, 11 Sep 2023 15:34:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qfivX-001OAD-4x for pgsql-general@arkaria.postgresql.org; Mon, 11 Sep 2023 15:34:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfivW-001OA1-Pe for pgsql-general@lists.postgresql.org; Mon, 11 Sep 2023 15:34:14 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qfivS-004Tc3-Bb for pgsql-general@lists.postgresql.org; Mon, 11 Sep 2023 15:34:13 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-99de884ad25so602798666b.3 for ; Mon, 11 Sep 2023 08:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694446448; x=1695051248; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=d2ADKtxg4F5Py/3vGajaGdYA6HM9qYSkTcJXJx02R3I=; b=lvIWivTSoKsBkvVPDFw+Hi0fjcFqJSeC9cK6BXtTrQ3Giekdux0gumU+yzeTzeSuNK DxhvSnJT79gliwWjyN3LK0bsrbHOptUUI87d62yK+P6sl87CzZP9ZDqWe7/ewpxTNGDj p3gcnnKXpHpzDP+tjAzax73zqfPU5GCmx60igIL0RUUJbGLWdFzo7fH3wEcTQY2bkivd bT1yjtVojU6/YGBepNOT0UuyFdBv2fLZ7p36g1gLZpdFMMrHP1PHL+KCWv58zkbHTDnp LyYS9SbQJlWt0mk0JiQfE13qYpgqZT14EQRFpsT/0MN4QcHPt6w34MmPNJuOl1stQW1z 6wKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694446448; x=1695051248; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d2ADKtxg4F5Py/3vGajaGdYA6HM9qYSkTcJXJx02R3I=; b=gGPMxVb6h3N9Dq18sBtKCi0ypWcLhFnNNBW5BTlikWWxad/Xv//xnKqoxEPrnGtJgC EisOj/RvvEeSrDAWeRjsbPbZW2PLIfpT8z4SybcKNs2tQXXyHG/FE3SYQsLpnpkQ+Bwg QNxuXTHZgWFdSpm6o5ietv9MFfGVssL+GDtv1w6209htiqzxE+gH9f+bYx1sz1OzJjjf HskX4+BWFqulPYz17IM2p4ULKxVvuGAqw1RRohFk4s91RfiYybEp7CsVYoCRlYnI0lTy QvD6WWFCaYqf5SrL/xPmqiIup/WQnfbg+b8lXh03r1VAWdGB69t5b9EOb4q5junEzfNV Zqtg== X-Gm-Message-State: AOJu0YwiyF89hkAyqrym5b/a0qNfSv61jrNZG2AlP2YmFIY1CgPEx0h8 2YCBg5r1F1GFYX4icGKIY9w= X-Google-Smtp-Source: AGHT+IGrBh0Mn9VPidQUnz/MBQuNdln0r16fAgrYMIsZMhD9RUe7Ci88C4QPE3pLEw4piORaNs0ufw== X-Received: by 2002:a17:906:314e:b0:987:4e89:577f with SMTP id e14-20020a170906314e00b009874e89577fmr8784249eje.24.1694446447805; Mon, 11 Sep 2023 08:34:07 -0700 (PDT) Received: from smtpclient.apple (217-19-30-105.dsl.cambrium.nl. [217.19.30.105]) by smtp.gmail.com with ESMTPSA id r16-20020a170906351000b0099bd86f9248sm5522201eja.63.2023.09.11.08.34.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2023 08:34:07 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: Making Sure Primary and Secondary Keys Alligns From: Alban Hertroys In-Reply-To: Date: Mon, 11 Sep 2023 17:33:56 +0200 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Anthony Apollis X-Mailer: Apple Mail (2.3731.500.231) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 11 Sep 2023, at 16:09, Anthony Apollis = wrote: >=20 > Fact Table: > CREATE TABLE IF NOT EXISTS system."IMETA_ZTRB_MP$F_ZTBR_TA_BW" > ( (=E2=80=A6) > ) > and Dimension:CREATE TABLE IF NOT EXISTS dim."IMETA_Region_Mapping" > ( (=E2=80=A6) > ) > How do i get that all these columns that are joined are aligned, = meaning if it starts with 1 in one column it must be 1 in the other = columns. Or how would you assign unique keys in Postgres? Are you perhaps asking how to define FOREIGN KEY CONSTRAINTs? = https://www.postgresql.org/docs/15/ddl-constraints.html#DDL-CONSTRAINTS-FK= Regards, Alban Hertroys -- There is always an exception to always.