This article is half-done without your Comment! *** Please share your thoughts via Comment ***
Table IF NOT EXISTS is available from PostgreSQL 9.1.
I am sharing this primary because many people are still using PostgreSQL old version.
Also, notice that People who are using PostgreSQL new version those are still not using TABLE IF NOT EXISTS.
Because, before PostgreSQL 9.1 this was not there and still they perception is the same.
And even not changing there old code or script.
Now, TABLE IF NOT EXISTS is available so not require to scan any catalog table for checking the table existence.
Check the sample:
If the table exists, you get a message like a table already exists.
1 2 3 |
CREATE TABLE IF NOT EXISTS tbl_Test (Rno INT); NOTICE: relation "tbl_test" already exists, skipping |
Leave a Reply