pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: ERROR: operator does not exist: timestamp without time zone + integer
Date: Tue, 30 Apr 2019 20:11:59 +0100
Message-ID: <878svrux71.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <1e02f867-5b18-0f0d-2aae-4f28bc3300e3@aklaver.com>
References: <BL0PR01MB51876A1315E10193A51DF8FA9B3A0@BL0PR01MB5187.prod.exchangelabs.com>
	<12869367-4dae-37ee-0a2e-c94d04fc9427@gmx.net>
	<795d66f1-46cf-7171-5442-1ee1618f3e8f@aklaver.com>
	<87d0l3v8t9.fsf@news-spur.riddles.org.uk>
	<1e02f867-5b18-0f0d-2aae-4f28bc3300e3@aklaver.com>

>>>>> "Adrian" == Adrian Klaver <adrian.klaver@aklaver.com> writes:

 >> yeesh. that's a very long-winded way to write current_date + 7

 Adrian> Yeah, I was just working of the OP's original DEFAULT:

 Adrian> site_mode_date timestamp NOT NULL DEFAULT date_trunc('day',
 Adrian> LOCALTIMESTAMP)+7,

Right, but since all these are exactly equivalent:

CURRENT_DATE
LOCALTIMESTAMP::date
date_trunc('day',LOCALTIMESTAMP)::date

and since date can be cast to timestamp, then DEFAULT current_date+7
would seem to be the simplest answer.

-- 
Andrew (irc:RhodiumToad)





view thread (8+ messages)  latest in thread

Message-ID: <878svrux71.fsf@news-spur.riddles.org.uk>
Permalink:  ../878svrux71.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/878svrux71.fsf@news-spur.riddles.org.uk

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, adrian.klaver@aklaver.com, spam_eater@gmx.net
  Subject: Re: ERROR: operator does not exist: timestamp without time zone + integer
  In-Reply-To: <878svrux71.fsf@news-spur.riddles.org.uk>
  References: <BL0PR01MB51876A1315E10193A51DF8FA9B3A0@BL0PR01MB5187.prod.exchangelabs.com> <12869367-4dae-37ee-0a2e-c94d04fc9427@gmx.net> <795d66f1-46cf-7171-5442-1ee1618f3e8f@aklaver.com> <87d0l3v8t9.fsf@news-spur.riddles.org.uk> <1e02f867-5b18-0f0d-2aae-4f28bc3300e3@aklaver.com> <878svrux71.fsf@news-spur.riddles.org.uk>

* 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