-1

I have to create a table in pgAdmin4 with a foreign key that self-references the same table, but a different column. The name of the table is 'passageiros'(passengers), and there is a column called 'nome' (name) and '&passResponsavel' (Responsible Passanger, the foreign key). I'm trying to make &passResponsavel reference nome in case a passanger is underage (I do not need to put an age constraint).

I've been trying to make the foreign key the same way I make one that references a different table, but I've been receiving this error message:

enter image description here

But both of them have the same type. I'll leave here the columns properties just in case

enter image description here

Am I missing something when doing self-reference?

Maju
  • 1
  • 1

0 Answers0