[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: installin postgresql-contrib



On Wed, 2003-09-17 at 14:24, Alexei Chetroi wrote:
>  Hi All,
> 
>  I want to add some function to postgres database from
> postgresql-contrib package (some encryption functions). Packages install
> normally, but when I'm trying to add functions to database it complains:
> 
> [lex.lexa]$ psql mf </usr/lib/postgresql/contrib/pgcrypto.sql 
> SET
> SET
> ERROR:  c: permission denied
> ERROR:  c: permission denied

You will find it easier to understand what is happening if you use the
-e option to psql, which will show you the queries that are being
executed.  This is the start of the sql script:

        -- Adjust this setting to control where the objects get created.
        SET search_path = public;
         
        SET autocommit TO 'on';
         
        CREATE OR REPLACE FUNCTION digest(text, text)
        RETURNS bytea
        AS '$libdir/pgcrypto', 'pg_digest'
        LANGUAGE 'C';
         
        CREATE OR REPLACE FUNCTION digest(bytea, text)
        RETURNS bytea
        AS '$libdir/pgcrypto', 'pg_digest'
        LANGUAGE 'C';

I think that your problem is that you (the current postgresql user) does
not have permission to create a C language function.  Such a function
would have complete access to any database structures and could be used
to bypass access security, so you should probably be running as postgres
superuser to do this successfully.

I can't find the documentation references for this, and I am running
7.4beta so I can't conduct a valid test.  I asssume you are running
7.2.1?

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Give, and it shall be given unto you; good measure, 
      pressed down, and shaken together, and running over, 
      shall men pour into your lap. For by your standard of 
      measure it will be measured to you in return."
                                           Luke 6:38 



Reply to: