Re: New data type: uniqueidentifier
Dmitry G. Mastrukov <dmitry@taurussoft.org>
From: "Dmitry G. Mastrukov" <dmitry@taurussoft.org>
To: "Alex Pilosov" <alex@pilosoft.com>
Cc: <pgsql-hackers@postgresql.org>
Date: 2001-06-27T22:21:11Z
Lists: pgsql-hackers
Alex Pilosov <alex@pilosoft.com> wrote:
> On Tue, 26 Jun 2001, Dmitry G. Mastrukov wrote:
>
> > myself some things.
> > I've marked "=" operator with HASH clause (and planner has started to
use
> > hash jons). But as I understand the right way is to create special hash
> > function (may be wrapper for hash_any(), isn't it?) and register it for
hash
> > as for btree method.
>
> No. Currently, there's no way to specify a hash function for a given
> operator, it always uses a builtin function that operates on memory
> representation of a value.
>
> There's no need (or possibility) to register a hash with btree method.
>
Strange. When I execute following query (slightly modified query from User's
Guide chapter 7.6)
SELECT am.amname AS acc_name,
opc.opcname AS ops_name,
opr.oprname AS ops_comp
FROM pg_am am, pg_amop amop,
pg_opclass opc, pg_operator opr
WHERE amop.amopid = am.oid AND
amop.amopclaid = opc.oid AND
amop.amopopr = opr.oid
ORDER BY ops_name, ops_comp;
I see both hash and btree amname for builtin opclasses. For example
acc_name | ops_name | ops_comp
----------+----------+----------
btree | int4_ops | <
btree | int4_ops | <=
btree | int4_ops | =
hash | int4_ops | =
btree | int4_ops | >
btree | int4_ops | >=
But new type has no hash for "=". Plus I saw hash functions for builtin
types in source code. So can I achieve for created type such intergration
with Postgres as for builtin types? Or am I understanding something wrong?
regards,
Dmitry