Thread: howto use pgencrypto ?

howto use pgencrypto ?

From
David H
Date:
Hi,

I have installed pgencrypot so I think...
I ran make checkinstall I got:

============== installing PL/pgSQL
==============
============== running regression test queries
==============
test init                 ... ok
test md5                  ... ok
test sha1                 ... ok
test hmac-md5             ... ok
test hmac-sha1            ... ok
test blowfish             ... ok
test rijndael             ... ok
test crypt-des            ... ok
test crypt-md5            ... ok
test crypt-blowfish       ... ok
test crypt-xdes           ... ok

======================
 All 11 tests passed.
======================

But when I ran:

select encrypt
('srcip'::bytea,'pass'::bytea,'bf'::text)::bytea as
"test" from tbltcplog limit 3;

I got:

ERROR:  Function encrypt(bytea, bytea, text) does not
exist
        Unable to identify a function that satisfies
the given argument types
        You may need to add explicit typecasts

Please help!!!!
Thanks,
Dave

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

Re: howto use pgencrypto ?

From
Joe Conway
Date:
David H wrote:

> select encrypt
> ('srcip'::bytea,'pass'::bytea,'bf'::text)::bytea as
> "test" from tbltcplog limit 3;
>
> I got:
>
> ERROR:  Function encrypt(bytea, bytea, text) does not
> exist
>         Unable to identify a function that satisfies
> the given argument types
>         You may need to add explicit typecasts

The pgcrypto README doesn't seem to mention it, but in general, after
building any of the contrib libraries, you need to "load" them into any
databases in which you want to use their functions. Something like:

psql mydatabase < pgcrypto.sql

However, If you are using the regression database after running make
installcheck, the functions should be there. I get this:

regression=# \df encrypt
                      List of functions
  Result data type | Schema |  Name   | Argument data types
------------------+--------+---------+---------------------
  bytea            | public | encrypt | bytea, bytea, text
(1 row)

So I'd conclude you are not using the regression database and need to
follow the first suggestion ;-)

HTH,

Joe



Re: howto use pgencrypto ?

From
"Simon Chalmers"
Date:
I was just having the exact same problem, thanks for your post Joe. :)
----- Original Message -----
From: "Joe Conway" <mail@joeconway.com>
To: "David H" <godave621@yahoo.com>
Cc: <pgsql-novice@postgresql.org>
Sent: Friday, December 05, 2003 2:23 PM
Subject: Re: [NOVICE] howto use pgencrypto ?


> David H wrote:
>
> > select encrypt
> > ('srcip'::bytea,'pass'::bytea,'bf'::text)::bytea as
> > "test" from tbltcplog limit 3;
> >
> > I got:
> >
> > ERROR:  Function encrypt(bytea, bytea, text) does not
> > exist
> >         Unable to identify a function that satisfies
> > the given argument types
> >         You may need to add explicit typecasts
>
> The pgcrypto README doesn't seem to mention it, but in general, after
> building any of the contrib libraries, you need to "load" them into any
> databases in which you want to use their functions. Something like:
>
> psql mydatabase < pgcrypto.sql
>
> However, If you are using the regression database after running make
> installcheck, the functions should be there. I get this:
>
> regression=# \df encrypt
>                       List of functions
>   Result data type | Schema |  Name   | Argument data types
> ------------------+--------+---------+---------------------
>   bytea            | public | encrypt | bytea, bytea, text
> (1 row)
>
> So I'd conclude you are not using the regression database and need to
> follow the first suggestion ;-)
>
> HTH,
>
> Joe
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
>



Re: howto use pgencrypto ?

From
"Simon Chalmers"
Date:
I was just having the exact same problem, thanks for your post Joe. :)


----- Original Message -----
From: "Joe Conway" <mail@joeconway.com>
To: "David H" <godave621@yahoo.com>
Cc: <pgsql-novice@postgresql.org>
Sent: Friday, December 05, 2003 2:23 PM
Subject: Re: [NOVICE] howto use pgencrypto ?


> David H wrote:
>
> > select encrypt
> > ('srcip'::bytea,'pass'::bytea,'bf'::text)::bytea as
> > "test" from tbltcplog limit 3;
> >
> > I got:
> >
> > ERROR:  Function encrypt(bytea, bytea, text) does not
> > exist
> >         Unable to identify a function that satisfies
> > the given argument types
> >         You may need to add explicit typecasts
>
> The pgcrypto README doesn't seem to mention it, but in general, after
> building any of the contrib libraries, you need to "load" them into any
> databases in which you want to use their functions. Something like:
>
> psql mydatabase < pgcrypto.sql
>
> However, If you are using the regression database after running make
> installcheck, the functions should be there. I get this:
>
> regression=# \df encrypt
>                       List of functions
>   Result data type | Schema |  Name   | Argument data types
> ------------------+--------+---------+---------------------
>   bytea            | public | encrypt | bytea, bytea, text
> (1 row)
>
> So I'd conclude you are not using the regression database and need to
> follow the first suggestion ;-)
>
> HTH,
>
> Joe
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
>