Sometime an application may need access to specific Postgres functions, but for security reason, the application's database user may not have superuser privileges to enable extensions in Postgres (which is a good thing).
Here's how you can enable the necessary extension on a specific database using the superuser account. After the extensions are enabled on a database, the database user will be able to use it.
Here's how you can enable the necessary extension on a specific database using the superuser account. After the extensions are enabled on a database, the database user will be able to use it.
- Login to Postgres PSQL prompt as superuser
sudo -u postgres psql
- Connect to the database which needs the extensions
\c mydatabase
(use \l to list databases) - Enable the extension on the database
CREATE EXTENSION "uuid-ossp";
- Quit PSQL
\q
Comments
Post a Comment