pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alban Hertroys <haramrae@gmail.com>
To: Anthony Apollis <anthony.apollis@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Making Sure Primary and Secondary Keys Alligns
Date: Mon, 11 Sep 2023 17:33:56 +0200
Message-ID: <F24C8886-04BA-4AC2-9A46-77DA06EAE187@gmail.com> (raw)
In-Reply-To: <CAJyMCYKmTBJqgWepFH3tkTS6L_wpSTJqCSLQNm6Jr1QrH63CtA@mail.gmail.com>
References: <CAJyMCYKmTBJqgWepFH3tkTS6L_wpSTJqCSLQNm6Jr1QrH63CtA@mail.gmail.com>


> On 11 Sep 2023, at 16:09, Anthony Apollis <anthony.apollis@gmail.com> wrote:
> 
> Fact Table:
> CREATE TABLE IF NOT EXISTS system."IMETA_ZTRB_MP$F_ZTBR_TA_BW"
> (

(…)

> )

> and Dimension:CREATE TABLE IF NOT EXISTS dim."IMETA_Region_Mapping"
> (

(…)

> )

> 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.









view thread (4+ messages)  latest in thread

Message-ID: <F24C8886-04BA-4AC2-9A46-77DA06EAE187@gmail.com>
Permalink:  ../F24C8886-04BA-4AC2-9A46-77DA06EAE187@gmail.com/
Also on:    postgresql.org/message-id/F24C8886-04BA-4AC2-9A46-77DA06EAE187@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: haramrae@gmail.com, anthony.apollis@gmail.com
  Subject: Re: Making Sure Primary and Secondary Keys Alligns
  In-Reply-To: <F24C8886-04BA-4AC2-9A46-77DA06EAE187@gmail.com>
  References: <CAJyMCYKmTBJqgWepFH3tkTS6L_wpSTJqCSLQNm6Jr1QrH63CtA@mail.gmail.com> <F24C8886-04BA-4AC2-9A46-77DA06EAE187@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