Re: configure --with-uuid=bsd fails on NetBSD - Mailing list pgsql-hackers

From Tom Lane
Subject Re: configure --with-uuid=bsd fails on NetBSD
Date
Msg-id 1926640.1661530896@sss.pgh.pa.us
Whole thread Raw
In response to Re: configure --with-uuid=bsd fails on NetBSD  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
Responses Re: configure --with-uuid=bsd fails on NetBSD
List 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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: standby promotion can create unreadable WAL
Next
From: Robert Haas
Date:
Subject: Re: postgres_fdw hint messages