Re: difference between implicit/explicit cast of integer to interval

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: raf <raf(at)raf(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: difference between implicit/explicit cast of integer to interval
Date: 2012-07-02 04:54:40
Message-ID: 22536.1341204880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

raf <raf(at)raf(dot)org> writes:
> Q1) if an integer cannot be explicitly cast into an interval, what is happening
> when a date difference is stored in an interval variable to allow it to happen?

plpgsql is really lax about type coercions. It typically does them by
converting the source value to text and then converting that string to
the target type. If we were designing that language today, I doubt
we'd have accepted such a definition, but changing it now would break
a lot of code ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Janne H 2012-07-02 07:33:04 Do I need archive_mode = on for hot standby?
Previous Message raf 2012-07-02 04:25:56 difference between implicit/explicit cast of integer to interval