Re: Making Sure Primary and Secondary Keys Alligns

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Anthony Apollis <anthony(dot)apollis(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Making Sure Primary and Secondary Keys Alligns
Date: 2023-09-11 15:33:56
Message-ID: F24C8886-04BA-4AC2-9A46-77DA06EAE187@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On 11 Sep 2023, at 16:09, Anthony Apollis <anthony(dot)apollis(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Graeme 2023-09-11 16:04:54 Upgrade problem
Previous Message Anthony Apollis 2023-09-11 14:09:46 Making Sure Primary and Secondary Keys Alligns