Ich meine Dinge wie:Postgres: Sind verschachtelte Fremdschlüssel erlaubt?
FK1 -> 1FK2 -> 2PK
Bitte beachten Sie, dass 1FK2 ein PK FK1 ist, aber die 1FK2 ist ein FK zu 2PK. Der Schlüssel in der verschachtelten Struktur ist also ein FK und ein PK.
Ein Beispiel:
--- Like an interface
CREATE TABLE q_content (
user_id SERIAL PRIMARY KEY, ---);
---- tables that refer to it
CREATE TABLE questions (
user_id SERIAL
references q_content(user_id) ---);
CREATE TABLE removed_questions (
user_id SERIAL
references questions(user_id) ---);
+1 für den Tangentialpunkt –