pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedgen_random_uuid is only available with pgcrypto enabled
3+ messages / 3 participants
[nested] [flat]
* gen_random_uuid is only available with pgcrypto enabled
@ 2023-01-24 13:56 PG Doc comments form <noreply@postgresql.org>
0 siblings, 2 replies; 3+ messages in thread
From: PG Doc comments form @ 2023-01-24 13:56 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: eike.send@gmail.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/15/functions-uuid.html
Description:
Regarding the documentation on this page:
https://www.postgresql.org/docs/15/functions-uuid.html
It think the documentation should state clearly, that postgres natively does
not have any UUID generation functions. You can use the `pgcrypto` or
`uuid-ossp` extensions though:
CREATE EXTENSION "pgcrypto"; /* enable pgcrypto extension */
SELECT public.gen_random_uuid(); /* -> uuid */
See https://www.postgresql.org/docs/current/pgcrypto.html#id-1.11.7.37.11
CREATE EXTENSION "uuid-ossp"; /* enable uuid-ossp extension */
SELECT public.uuid_generate_v4(); /* -> uuid */
See https://www.postgresql.org/docs/current/uuid-ossp.html
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: gen_random_uuid is only available with pgcrypto enabled
@ 2023-01-24 20:03 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Doc comments form <noreply@postgresql.org>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2023-01-24 20:03 UTC (permalink / raw)
To: eike.send@gmail.com; +Cc: pgsql-docs@lists.postgresql.org
PG Doc comments form <noreply@postgresql.org> writes:
> Regarding the documentation on this page:
> https://www.postgresql.org/docs/15/functions-uuid.html
> It think the documentation should state clearly, that postgres natively does
> not have any UUID generation functions.
That hasn't been true since we added gen_random_uuid() to the
core code in v13. pgcrypto's version is now just a deprecated
wrapper for that.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: gen_random_uuid is only available with pgcrypto enabled
@ 2023-01-24 20:03 David G. Johnston <david.g.johnston@gmail.com>
parent: PG Doc comments form <noreply@postgresql.org>
1 sibling, 0 replies; 3+ messages in thread
From: David G. Johnston @ 2023-01-24 20:03 UTC (permalink / raw)
To: eike.send@gmail.com; pgsql-docs@lists.postgresql.org
On Tue, Jan 24, 2023 at 12:43 PM PG Doc comments form <
noreply@postgresql.org> wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/15/functions-uuid.html
> Description:
>
> Regarding the documentation on this page:
> https://www.postgresql.org/docs/15/functions-uuid.html
>
> It think the documentation should state clearly, that postgres natively
> does
> not have any UUID generation functions.
But that isn't true...
postgres=# select * from pg_extension;
oid | extname | extowner | extnamespace | extrelocatable | extversion |
extconfig | extcondition
-------+---------+----------+--------------+----------------+------------+-----------+--------------
12765 | plpgsql | 10 | 11 | f | 1.0 |
|
(1 row)
postgres=# select gen_random_uuid();
gen_random_uuid
--------------------------------------
0a1be850-b1ae-48b9-bfe1-038df1e227f7
(1 row)
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-01-24 20:03 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24 13:56 gen_random_uuid is only available with pgcrypto enabled PG Doc comments form <noreply@postgresql.org>
2023-01-24 20:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-01-24 20:03 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox