Bram Hagens <bram@bramh.me> writes:
> I would like to propose adding IF NOT EXISTS support to all CREATE TYPE
> variants
> for consistency with other CREATE commands (CREATE TABLE, CREATE INDEX,
> etc.).
There has been a *ton* of discussion about this over the years.
If you didn't find anything in the archives, you didn't look hard.
The short answer about why this isn't as useful as it might seem
is that after CINE, your application is entitled to make exactly
zero assumptions about the properties of the object, other than
that it exists. CREATE OR REPLACE functionality is a lot more
reliable to depend on, since if it succeeds you know exactly
how the object is defined. (However, then you have the issue
of whether the server can cope with possibly propagating changes
in the object definition.)
regards, tom lane