pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
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 15:25:38 -0700
Message-ID: <db5a7bad-88a8-4720-37ec-23e014a3532d@aklaver.com> (raw)
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>

On 4/30/19 12:11 PM, Andrew Gierth wrote:
>>>>>> "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.
> 

I would agree. Put it down to a case of tunnel vision.


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (8+ messages)

Message-ID: <db5a7bad-88a8-4720-37ec-23e014a3532d@aklaver.com>
Permalink:  ../db5a7bad-88a8-4720-37ec-23e014a3532d@aklaver.com/
Also on:    postgresql.org/message-id/db5a7bad-88a8-4720-37ec-23e014a3532d@aklaver.com

 · 

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: adrian.klaver@aklaver.com, andrew@tao11.riddles.org.uk, spam_eater@gmx.net
  Subject: Re: ERROR: operator does not exist: timestamp without time zone + integer
  In-Reply-To: <db5a7bad-88a8-4720-37ec-23e014a3532d@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> <878svrux71.fsf@news-spur.riddles.org.uk> <db5a7bad-88a8-4720-37ec-23e014a3532d@aklaver.com>

* 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