I know that it is not available in PostgreSQL, I'll request the justification only why this helpful is not provided in it which is available in other RDBMSs. Though, it can be implemented using the programing languages having interfaces to PostgreSQL, there may be a specific reason that the designers have taken this decision to exclude it. I wish to know the merits of excluding this construct.

The other answers to similar questions seems to highlight how to mimic it using other ways. I'm not expecting that. I just want the design logic for this. If I've missed any such question, which has an answer to this point, please point me to that.

1

There are 1 best solutions below

2
On

Look at this thread on the pgsql-hackers list about an attempt to introduce that feature:

FWIW, I'm generally hostile to CREATE IF NOT EXISTS semantics across the board, because of its exceedingly squishy semantics: it ensures that an object by that name exists, but you have exactly no guarantees about its properties or contents. The more complex the object, the bigger that problem becomes ... and a whole database is the most complex sort of object we have. So IMV, the fact that we don't have this "feature" is a good thing.

We do have DROP DATABASE IF EXISTS, and I think using that followed by CREATE is a much better-defined approach.