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

2008-12-17 Thread Kris Jurka
Miroslav Nachev wrote: I try to use it but I have the following exception: java.lang.IllegalArgumentException: Unknown entity: java.util.UUID at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:223) at psqluuidtest.Main.persist(Main.java:33)

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

2008-12-17 Thread Kris Jurka
On Wed, 17 Dec 2008, 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? The server uuid type is already mapped to java.util.UUID in recent JDBC driver versions: http://archiv

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

2008-12-17 Thread Miroslav Nachev
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.

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

2008-12-17 Thread Miroslav Nachev
Dear Heikki, Thank you very much. How can I map PostgreSQL UUID to JPA Hibernate with annotations? Serializable or BigInteger or byte[] or java.util.UUID? 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

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

2008-12-17 Thread Heikki Linnakangas
Miroslav Nachev wrote: And how to specify that bytea MUST be exact 16 bytes? Well, you could put a constraint on the column, or create a domain with such a constraint. But if you're dealing with uuids, you really want to use the UUID data type anyway. What about the speed because this is v

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

2008-12-17 Thread Heikki Linnakangas
(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

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

2008-12-17 Thread Heikki Linnakangas
Miroslav Nachev wrote: Most of the popular databases (Oracle, MySQL, MS SQL, etc.) support binary column type which can be used as primary key. For example UUID algorithm need of exact 16 bytes and is very useful for Primary Key. Of course it can be presented with characters in Hex format but in

[BUGS] BUG #4586: Supporting of Binary instead Bytea for Primary Keys

2008-12-17 Thread Miroslav Nachev
The following bug has been logged online: Bug reference: 4586 Logged by: Miroslav Nachev Email address: m...@space-comm.com PostgreSQL version: 8.3 Operating system: Windows Description:Supporting of Binary instead Bytea for Primary Keys Details: Most of the popular