Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys

From: "Miroslav Nachev" <miro(at)space-comm(dot)com>
To: "PostgreSQL Bugs" <pgsql-bugs(at)postgresql(dot)org>
Cc: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Subject: Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys
Date: 2008-12-17 09:36:08
Message-ID: fdd50acd0812170136w5f6ce5aw828330affeaa0fc8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

And how to specify that bytea MUST be exact 16 bytes? What about the speed
because this is very important?
1st of all when the length is variable then the speed is low.
2nd when the column is with bigger length which require pointer to the data
instead data, then the speed will be extremely low.

Miro.

On Wed, Dec 17, 2008 at 11:19 AM, Heikki Linnakangas <
heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:

> (please keep the mailing list cc'd. (or take this to a more relevant list,
> actually)).
>
> Miroslav Nachev wrote:
>
>> Thank you very much. How can I map PostgreSQL UUID to JPA Hibernate with
>> annotations? Serializable or BigInteger or byte[] or java.util.UUID?
>>
>
> No idea.
>
> The big disadvantage of bytea is that it is not possible to use that type
>> in
>> indexes and primary keys. Probably this restriction is because is very
>> slow
>> column type because instead to keep the data this column keeps pointer to
>> the data.
>>
>
> Huh? Of course it's possible:
>
> postgres=# CREATE TABLE foo (id bytea PRIMARY KEY);
> NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey"
> for table "foo"
> CREATE TABLE
> postgres=# CREATE INDEX i_foo ON foo (id);
> CREATE INDEX
> postgres=#
>
>
> --
> Heikki Linnakangas
> EnterpriseDB http://www.enterprisedb.com
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2008-12-17 09:45:33 Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys
Previous Message Heikki Linnakangas 2008-12-17 09:19:38 Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys