Posts

This profile is from a federated server and may be incomplete. Browse more on the original instance.

xocolatl, to postgres

Hey people.

Do you use ±infinity in your dates and timestamps? What is your use case? What would you do instead if they weren't available?

Please boost for reach.

truls46,
@truls46@mastodon.social avatar

@tshirtman

If the column represents e.g. an expiration date (where NULL means "does not expire") you would need something like:

WHERE col <= some_constant OR col IS NULL

which typically won't use an index.

When using +infinity the OR .. IS NULL is no longer necessary which then opens up the possibility to use an index.

tshirtman,
@tshirtman@mas.to avatar

@truls46 ok, for this case, where indeed you want to express "does not expire" (like, a permission, or something immaterial of the kind), i do think it make sense.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • osvaldo12
  • ngwrru68w68
  • GTA5RPClips
  • provamag3
  • InstantRegret
  • everett
  • Durango
  • cisconetworking
  • khanakhh
  • ethstaker
  • tester
  • anitta
  • Leos
  • normalnudes
  • modclub
  • megavids
  • lostlight
  • All magazines