Postgres Extension "uuid-ossp" disappearing?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
In postgres it is necessary to create an extension first so that you can use the SQL function uuid_generate_v4() to create UUIDs.
The syntax is
(yes, double-quotes are needed in this case)
I noticed now for the second time, that it can happen that the extension disappears suddenly on the postgres server.
That is certainly fatal when you use UUIDs all over your application.
Does somebody know the core reason how this could happen and how to prevent this?
Is there for example kind of an autostart script for postgres that you can fill with SQL commands that will run whenever a postgres server starts up?
By the way, to list all installed extensions, one can use
The syntax is
- Code: Select all
create extension "uuid-ossp"
(yes, double-quotes are needed in this case)
I noticed now for the second time, that it can happen that the extension disappears suddenly on the postgres server.
That is certainly fatal when you use UUIDs all over your application.
Does somebody know the core reason how this could happen and how to prevent this?
Is there for example kind of an autostart script for postgres that you can fill with SQL commands that will run whenever a postgres server starts up?
By the way, to list all installed extensions, one can use
- Code: Select all
SELECT * FROM pg_extension