I have a table user with columns id, name, email
I have a table book with columns id, name, author (ForeignKey to user).
Is there a way to write this SQL query in PostgreSQL?
select name, author.email from book;
I would like to "follow" the FK via a dot, like it is possible in almost all programming languages.
A PostgreSQL only solution would be fine.
Maybe there is an PG extension which enables this?
Of course following the dot should be possible recursively:
Imagine user had a FK to tenant. Then
select author.tenant.name from book should work, too.