Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys
Date
Msg-id 4948C42A.4060309@enterprisedb.com
Whole thread Raw
In response to BUG #4586: Supporting of Binary instead Bytea for Primary Keys  ("Miroslav Nachev" <miro@space-comm.com>)
Responses Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys
List pgsql-bugs
(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

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #4586: Supporting of Binary instead Bytea for Primary Keys