Обсуждение: Minor patch for the uuid-ossp extension
When trying to add the extension with \i it writes an error message: Use "CREATE EXTENSION uuid-ossp" to load this file. Unfortunatly this does not work for extensions with dashes. Must CREATE EXTENSION "uuid-ossp". Proposed patch is attached. Regards Mario
Вложения
roadrunner6@gmx.at writes: > When trying to add the extension with \i it writes an error message: > Use "CREATE EXTENSION uuid-ossp" to load this file. > Unfortunatly this does not work for extensions with dashes. Must CREATE > EXTENSION "uuid-ossp". Proposed patch is attached. [ memo to self: never, ever accept another contrib module whose name isn't a plain SQL identifier ] Yeah, that's a problem, but I don't find your solution acceptable: -\echo Use "CREATE EXTENSION uuid-ossp" to load this file. \quit +\echo Use CREATE EXTENSION "uuid-ossp" to load this file. \quit That's just ignoring the English text quoting convention that these messages are trying to follow. I guess we could shade the convention a bit by using single not double quotes around the recommended command. psql doesn't make that tremendously easy, but a bit of experimentation says this works: regression=# \echo Use '''CREATE EXTENSION "uuid-ossp"''' to load this file. Use 'CREATE EXTENSION "uuid-ossp"' to load this file. Does that look reasonable to people? regards, tom lane
Tom Lane wrote: > roadrunner6@gmx.at writes: > regression=# \echo Use '''CREATE EXTENSION "uuid-ossp"''' to load this file. > Use 'CREATE EXTENSION "uuid-ossp"' to load this file. > > Does that look reasonable to people? +1 -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
On 11/22/2013 10:19 AM, Alvaro Herrera wrote: > Tom Lane wrote: >> roadrunner6@gmx.at writes: >> regression=# \echo Use '''CREATE EXTENSION "uuid-ossp"''' to load this file. >> Use 'CREATE EXTENSION "uuid-ossp"' to load this file. >> >> Does that look reasonable to people? > +1 > +1 cheers andrew
Am 22.11.2013 16:15, schrieb Tom Lane: > [ memo to self: never, ever accept another contrib module whose name > isn't a plain SQL identifier ] Well, in that case and since this is a rarely used extension (I guess so), maybe it would be the best to simply rename that extension to uuidossp (or whatever) and don't make any special treatment for it?
On 11/23/2013 01:12 PM, Mario Weilguni wrote: > Am 22.11.2013 16:15, schrieb Tom Lane: >> [ memo to self: never, ever accept another contrib module whose name >> isn't a plain SQL identifier ] > > Well, in that case and since this is a rarely used extension (I guess > so), maybe it would be the best to simply rename that extension to > uuidossp (or whatever) and don't make any special treatment for it? It'll definitely cause pain, but I'm all for normalizing the contrib names on sql identifiers, and this is the only outlier. -- Vik
23.11.2013 14:12, Mario Weilguni kirjoitti: > Am 22.11.2013 16:15, schrieb Tom Lane: >> [ memo to self: never, ever accept another contrib module whose name >> isn't a plain SQL identifier ] > > Well, in that case and since this is a rarely used extension (I guess > so), maybe it would be the best to simply rename that extension to > uuidossp (or whatever) and don't make any special treatment for it? There are a couple of threads about issues with uuid-ossp (AIUI it's abandonware at this point). If PostgreSQL had a proper PRNG with a 128-bit state it could just implement uuid_generate_v4() function in core and most people could probably drop uuid-ossp. I have a branch[1] which implements uuid_generate_v4 in core using pg_lrand48, but since it only has 48 bits of state it's probably not an acceptable replacement for uuid-ossp for now. Is anyone working on a new PRNG for PostgreSQL at the moment? / Oskari [1] https://github.com/saaros/postgres/compare/core-uuid-v4
On 11/23/13, 7:12 AM, Mario Weilguni wrote: > Well, in that case and since this is a rarely used extension (I guess > so), maybe it would be the best to simply rename that extension to > uuidossp (or whatever) and don't make any special treatment for it? Why? This is a solved problem, and renaming the extension would only cause unnecessary work.