Re: UUID question

2016-06-30 Thread Johann Werner
> Am 30.06.2016 um 13:06 schrieb Musall Maik : > > By the way, there is a bad NPE in the new UUID code that prevents object > insertion completely for tables that don't use a prototype for primary key. > Could please anyone merge the fix quickly? Done :-) > > https://github.com/wocommunity/w

Re: UUID question

2016-06-30 Thread Musall Maik
By the way, there is a bad NPE in the new UUID code that prevents object insertion completely for tables that don't use a prototype for primary key. Could please anyone merge the fix quickly? https://github.com/wocommunity/wonder/pull/779 ___ Do not

Re: UUID question

2016-06-28 Thread Theodore Petrosky
and I had to escape all those backslashes: String theSQL = "INSERT INTO person (active, firstname, lastname, username, password, creationdate, id) VALUES " + "(true, 'Ted', 'Petrosky', 'tedpet', '3368', now(), E'x" + UUIDUtilities.generateAsNSData()._hexString() +"')”; turn

Re: UUID question

2016-06-28 Thread Ramsey Gurley
https://www.postgresql.org/docs/9.0/static/datatype-binary.html bytea_output used to be escape by default. Somewhere along the way they changed it to hex. I find setting it to escape makes our WO things work properly. On Jun 28, 2016, at 6:52 AM, Theodore Petrosky wrote: > > INSERT INTO perso

Re: UUID question

2016-06-28 Thread Samuel Pelletier
Ted, Your first statement does not include the \\x in front of the literal, try : INSERT INTO person (first name, last name, id) VALUES ('Ted', 'Petrosky', E'\\x021D57D63ED54328A5411B07442E262E') See the PG doc for the binary data type: https://www.postgresql.org/docs/9.1/static/datatype-binar

Re: UUID question

2016-06-28 Thread Theodore Petrosky
INSERT INTO person (firstname, lastname, id) VALUES ('Ted', 'Petrosky', E'021D57D63ED54328A5411B07442E262E') this is what shows up in the database: \x3032314435374436334544353433323841353431314230373434324532363245 INSERT INTO person (firstname, lastname, id) VALUES ('Ted', 'Petrosky', de

Re: UUID question

2016-06-28 Thread Samuel Pelletier
Ted, They are probably 10 of other variations of this code but I do not think there is any best way, the data needs to be converted to hex for the SQL. I'm sot sure if the "decode(E'...')" part is required, based on pg doc, byte constant can be written as "E'\\xDEADBEEF'" so "E'\\x" + UUIDUtil

Re: UUID question

2016-06-28 Thread Paul Hoadley
Hi Ted, On 28 Jun 2016, at 7:39 PM, Theodore Petrosky wrote: > I am starting a new little project and I want to use the UUIDs. My migrations > usually start up by inserting a few entities by executing some SQL. > > The id column is not a ‘real’ postgresql UUID, it is a 128 bit bytea column.