Postgres Extension "uuid-ossp" disappearing?

Questions and answers regarding general SQL and backend databases

Postgres Extension "uuid-ossp" disappearing?

Postby Bernd.N » Mon Aug 08, 2016 10:28 pm

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
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
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 497
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 3 guests

cron