Re: configure --with-uuid=bsd fails on NetBSD
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nazir Bilal Yavuz <byavuz81@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org
Date: 2022-08-26T16:21:36Z
Lists: pgsql-hackers
Nazir Bilal Yavuz <byavuz81@gmail.com> writes:
> Based on these discussions, I attached a patch.
This is the wrong way to go about it:
+#if defined(__NetBSD__)
+ ereport(ERROR, errmsg("NetBSD's uuid_create function generates "
+ "version-4 UUIDs instead of version-1"));
+#endif
Older versions of NetBSD generated v1, so you'd incorrectly break
things on those. And who knows whether they might reconsider
in the future?
I think the right fix is to call uuid_create and then actually check
the version field of the result. This avoids breaking what need not
be broken, and it'd also guard against comparable problems on other
platforms (so don't blame NetBSD specifically in the message, either).
regards, tom lane
Commits
-
Reject bogus output from uuid_create(3).
- e55ccb3b179c 14.6 landed
- c4b6d218e369 16.0 landed
- a61095aa7946 13.9 landed
- 95028d9de422 10.23 landed
- 4d3f54bd7a0d 11.18 landed
- 23fe89a61223 12.13 landed
- 100a8ca2c285 15.0 landed