In a Hacker News discussion [2] on using foreign keys for joins, the author of PostgREST, Steve Chavez, mentioned they are actually already using this idea in PostgREST:
Steve Chavez wrote: >The idea about using FK as a JOIN target is interesting. >While developing a syntax for PostgREST resource embedding[1], >I also reached the conclusion that FKs would be a convenient way to join tables >(also suggested renaming them as you do here). > >IIRC, self joins are still an issue with FK joining. > >[1]: https://postgrest.org/en/v7.0.0/api.html#embedding-disambiguation I think this idea looks very promising and fruitful. Maybe we can think of some other existing/new operator which would be acceptable, instead of using "->" (which is potentially in conflict with the SQL standard's "REF" thing)? Not saying we should move forward on our own with this idea, but if we can come up with a complete proposal, maybe it can be presented as an idea to the SQL committee? [2] https://news.ycombinator.com/item?id=26693705 /Joel