Re: pgcrypto module for WINDOWS

From: Joe Conway <mail(at)joeconway(dot)com>
To: Mª José Sempere <mjose(at)pixelart(dot)es>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pgcrypto module for WINDOWS
Date: 2004-12-11 05:14:10
Message-ID: 41BA8222.8000409@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mª José Sempere wrote:
> We are interested in installing the pgcrypto module of PostgreSQL for
> Windows, In order to use the function digest() for creating index on
> bytea type fields:
>
> create unique index my_index on my_table (digest(my_bytea_field,
> 'md5'));

Um, why would you want to use digest() just so that you can index a
bytea field?

regression=# select version();
version
-----------------------------------------------------------------------
PostgreSQL 7.4.5 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3
20040412 (Red Hat Linux 3.3.3-7)
(1 row)

regression=# create table foo(f1 bytea, f2 text);
CREATE TABLE
regression=# create unique index idx1 on foo(f1);
CREATE INDEX
regression=# insert into foo values('abc\\001\\002xyz');
INSERT 32018907 1
regression=# set enable_seqscan to off;
SET
regression=# explain analyze select * from foo where f1 =
'abc\\001\\002xyz';
QUERY PLAN
------------------------------------------------------------------------
Index Scan using idx1 on foo (cost=0.00..4.82 rows=2 width=64)
(actual time=0.026..0.030 rows=1 loops=1)
Index Cond: (f1 = 'abc\\001\\002xyz'::bytea)
Total runtime: 0.114 ms
(3 rows)

HTH,

Joe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message William Yu 2004-12-11 07:45:50 Re: Backup is too slow
Previous Message Ron Peterson 2004-12-11 01:50:56 Re: fallback authentication