Skip site navigation (1) Skip section navigation (2)

Re: New data type: uniqueidentifier

From: "Dmitry G(dot) Mastrukov" <dmitry(at)taurussoft(dot)org>
To: "Alex Pilosov" <alex(at)pilosoft(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New data type: uniqueidentifier
Date: 2001-06-27 22:21:11
Message-ID: 001301c0ff57$7878e380$016ba8c0@taurussoft.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Alex Pilosov <alex(at)pilosoft(dot)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


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-06-27 23:03:02
Subject: Re: functions returning records
Previous:From: Peter EisentrautDate: 2001-06-27 21:55:29
Subject: Re: Re: 7.2 items

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group