Re: Minor patch for the uuid-ossp extension

Lists: pgsql-hackers
From: roadrunner6(at)gmx(dot)at
To: pgsql-hackers(at)postgresql(dot)org
Subject: Minor patch for the uuid-ossp extension
Date: 2013-11-22 12:55:16
Message-ID: 528F5434.6010807@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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

Attachment Content-Type Size
uuid-ossp-patch.txt text/plain 1.2 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: roadrunner6(at)gmx(dot)at
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor patch for the uuid-ossp extension
Date: 2013-11-22 15:15:44
Message-ID: 26813.1385133344@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

roadrunner6(at)gmx(dot)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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: roadrunner6(at)gmx(dot)at, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor patch for the uuid-ossp extension
Date: 2013-11-22 15:19:43
Message-ID: 20131122151943.GN6041@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> roadrunner6(at)gmx(dot)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


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, roadrunner6(at)gmx(dot)at, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor patch for the uuid-ossp extension
Date: 2013-11-22 15:30:28
Message-ID: 528F7894.7000601@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 11/22/2013 10:19 AM, Alvaro Herrera wrote:
> Tom Lane wrote:
>> roadrunner6(at)gmx(dot)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


From: Mario Weilguni <roadrunner6(at)gmx(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor patch for the uuid-ossp extension
Date: 2013-11-23 12:12:44
Message-ID: 52909BBC.7060806@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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?


From: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
To: Mario Weilguni <roadrunner6(at)gmx(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor patch for the uuid-ossp extension
Date: 2013-11-23 12:56:17
Message-ID: 5290A5F1.3030804@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Oskari Saarenmaa <os(at)ohmu(dot)fi>
To: Mario Weilguni <roadrunner6(at)gmx(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor patch for the uuid-ossp extension
Date: 2013-11-23 14:11:22
Message-ID: 5290B78A.7080100@ohmu.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Mario Weilguni <roadrunner6(at)gmx(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor patch for the uuid-ossp extension
Date: 2013-12-04 15:58:54
Message-ID: 529F513E.9090102@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.