samedi 15 août 2015

Why don't more databases support the IF NOT EXISTS clause?

I've been playing with multiple database engines, and I've found that a lot of the databases don't support the if not exists syntax that is available in SQLite.

For instances both mysql and postgresql will choke on, with a syntax error.

CREATE VIEW IF NOT EXISTS 'someview' AS SELECT something from a_table;

while SQLite will understand the intent and meaning of that. Postgresql and MySQL will also choke if you use the IF NOT EXISTS clause on anything other than a CREATE TABLE statement.

So, why isn't IF NOT EXISTS supported on more databases? It seems to be rather useful.

Aucun commentaire:

Enregistrer un commentaire