aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/uuid-ossp/uuid-ossp.c12
-rw-r--r--doc/src/sgml/installation.sgml2
-rw-r--r--doc/src/sgml/uuid-ossp.sgml2
3 files changed, 14 insertions, 2 deletions
diff --git a/contrib/uuid-ossp/uuid-ossp.c b/contrib/uuid-ossp/uuid-ossp.c
index b868812358d..1245af3abb3 100644
--- a/contrib/uuid-ossp/uuid-ossp.c
+++ b/contrib/uuid-ossp/uuid-ossp.c
@@ -285,6 +285,18 @@ uuid_generate_internal(int v, unsigned char *ns, const char *ptr, int len)
strlcpy(strbuf, str, 37);
/*
+ * In recent NetBSD, uuid_create() has started
+ * producing v4 instead of v1 UUIDs. Check the
+ * version field and complain if it's not v1.
+ */
+ if (strbuf[14] != '1')
+ ereport(ERROR,
+ (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+ /* translator: %c will be a hex digit */
+ errmsg("uuid_create() produced a version %c UUID instead of the expected version 1",
+ strbuf[14])));
+
+ /*
* PTR, if set, replaces the trailing characters of
* the uuid; this is to support v1mc, where a random
* multicast MAC is used instead of the physical one
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 9daa656a048..7c79608e551 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -1125,7 +1125,7 @@ build-postgresql:
<itemizedlist>
<listitem>
<para>
- <option>bsd</option> to use the UUID functions found in FreeBSD, NetBSD,
+ <option>bsd</option> to use the UUID functions found in FreeBSD
and some other BSD-derived systems
</para>
</listitem>
diff --git a/doc/src/sgml/uuid-ossp.sgml b/doc/src/sgml/uuid-ossp.sgml
index 359d3c01289..26bfb908dae 100644
--- a/doc/src/sgml/uuid-ossp.sgml
+++ b/doc/src/sgml/uuid-ossp.sgml
@@ -214,7 +214,7 @@ SELECT uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org');
at <ulink url="http://www.ossp.org/pkg/lib/uuid/"></ulink>, it is not well
maintained, and is becoming increasingly difficult to port to newer
platforms. <filename>uuid-ossp</filename> can now be built without the OSSP
- library on some platforms. On FreeBSD, NetBSD, and some other BSD-derived
+ library on some platforms. On FreeBSD and some other BSD-derived
platforms, suitable UUID creation functions are included in the
core <filename>libc</filename> library. On Linux, macOS, and some other
platforms, suitable functions are provided in the <filename>libuuid</filename>