Search Postgresql Archives

Re: pgcrypto

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

 



On Wed, Sep 23, 2015 at 8:46 AM, Ramesh T <rameshparnanditech@xxxxxxxxx> wrote:
Hi,
      i   created extension pgcrypto on public with postgres user.But while trying to use from my own schma suppose qa.

when i run digest in function  in my qa 

 CREATE OR REPLACE FUNCTION sha1(bytea) returns text AS $$
      SELECT encode(digest($1, 'sha1'), 'hex')
    $$ LANGUAGE SQL STRICT IMMUTABLE;

If "public" is not in your search_path, then you need to schema-qualify the name of the function when you use it:

 
 CREATE OR REPLACE FUNCTION sha1(bytea) returns text AS $
       SELECT encode(public.digest($1, 'sha1'), 'hex')
     $ LANGUAGE SQL STRICT IMMUTABLE;

It is a good idea to do that anyway.

Cheers,

Jeff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux