Skip to content

Instantly share code, notes, and snippets.

@thb
Created June 23, 2011 13:08
Show Gist options
  • Save thb/1042498 to your computer and use it in GitHub Desktop.
Save thb/1042498 to your computer and use it in GitHub Desktop.
Postgresql : grant usage of c language for a given user
postgres=# GRANT USAGE ON LANGUAGE c TO rails;
ERREUR: le langage « c » n'est pas de confiance
ASTUCE : Seuls les super-utilisateurs peuvent utiliser des langages qui ne sont pas
de confiance.
postgres=# UPDATE pg_language SET lanpltrusted = true WHERE lanname = 'c';
UPDATE 1
postgres=# GRANT USAGE ON LANGUAGE c TO rails;
GRANT
@thb
Copy link
Author

thb commented Jun 23, 2011

How to get the PostgreSQL 8.4 unaccent module?

Get archive at: http://launchpad.net/postgresql-unaccent/trunk/0.1/+download/postgresql-unaccent-0.1.tar.gz
Install dependencies:

sudo apt-get install libunac1 libunac1-dev postgresql-server-dev-8.4

Then just uncompress the archive, compile and install.

make
sudo make install

Then go to your database and create the unaccent functions:

sudo -s -u postgres
psql ps_intranet_staging
ps_intranet_staging=# \i /tmp/postgresql-unaccent-0.1/unaccent.sql
SET
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE TEXT SEARCH TEMPLATE
CREATE TEXT SEARCH DICTIONARY
COMMENT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment