What is a typical precision of gettimeofday()? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject What is a typical precision of gettimeofday()?
Date
Msg-id be0339cc-1ae1-4892-9445-8e6d8995a44d@eisentraut.org
Whole thread Raw
Responses Re: What is a typical precision of gettimeofday()?
Re: What is a typical precision of gettimeofday()?
List pgsql-hackers
Over in the thread discussing the addition of UUIDv7 support [0], there 
is some uncertainty about what timestamp precision one can expect from 
gettimeofday().

UUIDv7 uses milliseconds since Unix epoch, but can optionally use up to 
12 additional bits of timestamp precision (see [1]), but it can also 
just use a counter instead of the extra precision.  The current patch 
uses the counter method "because of portability concerns" (source code 
comment).

I feel that we don't actually have any information about this 
portability concern.  Does anyone know what precision we can expect from 
gettimeofday()?  Can we expect the full microsecond precision usually?


[0]: 
https://www.postgresql.org/message-id/flat/CAAhFRxitJv=yoGnXUgeLB_O+M7J2BJAmb5jqAT9gZ3bij3uLDA@mail.gmail.com
[1]: 
https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#section-6.2-5.6.1



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: A problem about partitionwise join
Next
From: Peter Eisentraut
Date:
Subject: Re: UUID v7