pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@MIT.EDU>
Cc: Jean-Luc Lachance <jllachan@nsd.ca>
Cc: josh@agliodbs.com, Michael Nachbaur <mike@nachbaur.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Forcing query to use an index
Date: Tue, 04 Mar 2003 17:33:20 -0500
Message-ID: <8864.1046817200@sss.pgh.pa.us> (raw)
In-Reply-To: <87r89mki4w.fsf@stark.dyndns.tv>
References: <9959CFC2-4DC7-11D7-90E0-000A27935D5A@nachbaur.com>
	<200303031532.47899.josh@agliodbs.com>
	<87d6l8hr18.fsf@stark.dyndns.tv>
	<3E650416.26C51435@nsd.ca>
	<87r89mki4w.fsf@stark.dyndns.tv>

Greg Stark <gsstark@MIT.EDU> writes:
> I admit using 9999-01-01 as a date gives me the willies. But it does match
> with the way the field is used and it produces nice clean index range
> lookups.

If you're willing to switch to type 'timestamp' then you could use the
special value 'infinity' (or '-infinity' when you need it to sort before
instead of after normal times).

There was some talk awhile back of making type 'date' support infinity
as well.  This'd cost one day at each end of the allowable range, which
doesn't seem like a big loss.  But no one's done the legwork.

			regards, tom lane



view thread (17+ messages)

Message-ID: <8864.1046817200@sss.pgh.pa.us>
Permalink:  ../8864.1046817200@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8864.1046817200@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gsstark@MIT.EDU, jllachan@nsd.ca, mike@nachbaur.com
  Subject: Re: Forcing query to use an index
  In-Reply-To: <8864.1046817200@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox