Re: configure --with-uuid=bsd fails on NetBSD

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: configure --with-uuid=bsd fails on NetBSD
Date: 2022-08-26 16:21:36
Message-ID: 1926640.1661530896@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nazir Bilal Yavuz <byavuz81(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-08-26 16:26:18 Re: postgres_fdw hint messages
Previous Message Robert Haas 2022-08-26 16:15:27 Re: standby promotion can create unreadable WAL