SQL language proposal: JOIN FOREIGN
gist.github.com
SQL language proposal: JOIN FOREIGN
1–10 of 206 posts
Re: SQL language proposal: JOIN FOREIGN
#2Thanks for all the valuable comments on last proposal. Excited to hear what you think about this update.
Re: SQL language proposal: JOIN FOREIGN
#3Re: SQL language proposal: JOIN FOREIGN
#4I prefer defining tables like this:
CREATE TABLE category (
id int GENERATED ALWAYS AS IDENTITY,
name text
);
CREATE TABLE post (
id int GENERATED ALWAYS AS IDENTITY,
category_id int
REFERENCES category (id)
ON DELETE CASCADE
);
That is, category.id rather than category.category_id.
But the USING clause doesn't work with that style, as far as I understand.This would make my queries nicer.
Re: SQL language proposal: JOIN FOREIGN
#5Reason being if you use the example they gave:
SELECT f.title, f.did, d.name, f.date_prod, f.kind FROM films f JOIN FOREIGN f.films_did_fkey d
You need to implicitly know the table that films_did_fkey points to, because 'd' is just a table alias. I can't think of anywhere else in the SQL standard where you can introduce a table alias without explicitly referencing the table. In my opinion making code essentially unreadable unless you have other background information is an antipattern.
Re: SQL language proposal: JOIN FOREIGN
#6SELECT -col1, -col14 FROM table LIMIT 50;
Where the minus sign means I don't want these two columns. I still don't see a way to do it easily (for Vertica and in Datagrip).
Re: SQL language proposal: JOIN FOREIGN
#7https://www.postgresql.org/message-id/flat/1aec0dd0-dc27-40e...
Re: SQL language proposal: JOIN FOREIGN
#8This is my "Thanks, I hate it" response. Reason being if you use the example they gave: SELECT f.title, f.did, d.name, f.date_prod, f.kind FROM films f JOIN FOREIGN f.films_did_fkey d You need to implicitly know the table that films_did_fkey points to, because 'd' is just a table alias. I can't think of anywhere else in the SQL standard where you can introduce a table alias without explicitly referencing the table. I…
SELECT f.title, f.did, d.name, f.date_prod, f.kind FROM films f JOIN FOREIGN f.distributors d
Re: SQL language proposal: JOIN FOREIGN
#9This is my "Thanks, I hate it" response. Reason being if you use the example they gave: SELECT f.title, f.did, d.name, f.date_prod, f.kind FROM films f JOIN FOREIGN f.films_did_fkey d You need to implicitly know the table that films_did_fkey points to, because 'd' is just a table alias. I can't think of anywhere else in the SQL standard where you can introduce a table alias without explicitly referencing the table. I…
Re: SQL language proposal: JOIN FOREIGN
#10This is my "Thanks, I hate it" response. Reason being if you use the example they gave: SELECT f.title, f.did, d.name, f.date_prod, f.kind FROM films f JOIN FOREIGN f.films_did_fkey d You need to implicitly know the table that films_did_fkey points to, because 'd' is just a table alias. I can't think of anywhere else in the SQL standard where you can introduce a table alias without explicitly referencing the table. I…