Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

602
Views
¿Cómo agregar una restricción de clave externa en una matriz en PostgreSQL?

¿Cómo agregar una restricción de clave externa en una matriz en PostgreSQL?

tabla de búsqueda de roles

 CREATE TABLE party_role_cd ( party_role_cd bigint NOT NULL, code character varying(80) NOT NULL, CONSTRAINT party_role_cd PRIMARY KEY (party_role_cd) );

El partido puede tener cero o muchos roles [relación 0-N]

 CREATE TABLE party ( party_id biging NOT NULL, party_role_cd bigint[] NOT NULL, CONSTRAINT party_id PRIMARY KEY (party_id) );

¿Cómo agregar la restricción de foreign key para party_role_cd array en la tabla party ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Eso no está implementado en PostgreSQL. Actualmente, las restricciones FK solo operan en igualdad entre valores de columnas completas. Sin referencias de matriz a elemento. Hay un elemento TODO abierto que se agregó en 2010. Consulte:

  • https://wiki.postgresql.org/wiki/Todo#Referential_Integrity
  • https://www.postgresql.org/id-mensaje/1288033876.6278.6.camel@vanquo.pezone.net

Incluso hubo intentos de implementarlo, pero nunca hasta el final.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!