pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
"Day" from 8am to 3am
3+ messages / 2 participants
[nested] [flat]

* "Day" from 8am to 3am
@ 2001-06-06 00:05 Judd Maltin <judd@maltin.org>
  2001-06-06 14:57 ` Re: "Day" from 8am to 3am Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Judd Maltin @ 2001-06-06 00:05 UTC (permalink / raw)
  To: pgsql-sql

Hi folks,

I have a special application that considers a playday to be from 8am to
3pm the next morning.  The system then does maintenance from 3am till 8am
(if necessary).

I'd like to ease application development by creating a new kind of
"playDay" to query from.  For example:

SELECT * FROM table WHERE timestamp IN date_trunc('playDay', timestamp);

Any ideas?
 
Where should I begin?  Or is this all just wrongheaded and should I put it
on the application level?

-judd




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: "Day" from 8am to 3am
  2001-06-06 00:05 "Day" from 8am to 3am Judd Maltin <judd@maltin.org>
@ 2001-06-06 14:57 ` Tom Lane <tgl@sss.pgh.pa.us>
  2001-06-06 15:17   ` Re: "Day" from 8am to 3am Judd Maltin <judd@maltin.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2001-06-06 14:57 UTC (permalink / raw)
  To: Judd Maltin <judd@maltin.org>; +Cc: pgsql-sql

Judd Maltin <judd@maltin.org> writes:
> I have a special application that considers a playday to be from 8am to
> 3pm the next morning.  The system then does maintenance from 3am till 8am
> (if necessary).

8am is in the eye of the beholder.  Why not run the system in a timezone
selected such that a playday starts at local midnight?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: "Day" from 8am to 3am
  2001-06-06 00:05 "Day" from 8am to 3am Judd Maltin <judd@maltin.org>
  2001-06-06 14:57 ` Re: "Day" from 8am to 3am Tom Lane <tgl@sss.pgh.pa.us>
@ 2001-06-06 15:17   ` Judd Maltin <judd@maltin.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Judd Maltin @ 2001-06-06 15:17 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

On Wed, 6 Jun 2001, Tom Lane wrote:

> Judd Maltin <judd@maltin.org> writes:
> > I have a special application that considers a playday to be from 8am to
> > 3pm the next morning.  The system then does maintenance from 3am till 8am
> > (if necessary).
> 
> 8am is in the eye of the beholder.  Why not run the system in a timezone
> selected such that a playday starts at local midnight?
> 
> 			regards, tom lane


Isn't changing the system for the application breaking a cardinal rule of
systems design?

I need the real time of day anyway.. I just want to make SELECTs easier.

-judd




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-06-06 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-06 00:05 "Day" from 8am to 3am Judd Maltin <judd@maltin.org>
2001-06-06 14:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-06-06 15:17   ` Judd Maltin <judd@maltin.org>

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