Quantcast
Channel: Planet PostgreSQL
Viewing all articles
Browse latest Browse all 9977

Nikolay Samokhvalov: Three Cases Against IF NOT EXISTS / IF EXISTS in Postgres DDL

$
0
0
EXISTS OR NOT EXISTS (meme)

What is this about?

Many DDL statements in PostgreSQL support modified IF EXISTS / IF NOT EXISTS. For example:

 test=# create table if not exists mytable(); CREATE TABLE test=# drop table if exists mytable; DROP TABLE 

I recommend using `IF EXISTS` / `IF NOT EXISTS` in DDL only when necessary. Here are three examples that demonstrate how the overuse of these words may lead to negative consequences.


Viewing all articles
Browse latest Browse all 9977

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>