How to add two different table column as reference in one field ( column ) in PostgreSQL?

Viewed 40

How to add two different table column as reference in one field ( column ) in PostgreSQL

below my psql query:

create table salary (
  "id"  SERIAL PRIMARY KEY,
  "user_id" VARCHAR REFERENCES user_management(user_id) REFERENCES driver_management(user_id),
   "basic_pay" INT,
  "pay_group" VARCHAR,
  "pay_method" Pay_Method,
  "pay_cycle"  Pay_Cycle,
  "bank_name" VARCHAR,
  "account_number" numeric(26),
  "lmts" timestamp default current_timestamp
);

I face this Error: enter image description here

case:

  • I my case, I have 3 table, "salary", "user_management", "driver_management"
  • "user_management" and "driver_management" both table have column "user_id"
  • "user_id" in these two separate tables should use only one column "salary" > "user_id" as reference.

WHAT I AM EXPECT: enter image description here

0 Answers
Related