Search Postgresql Archives

Re: Re:Re: psql:t_mstr.sql:994: ERROR: function to_char(numeric) does not exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 27/04/2023 13:20 CEST gzh <gzhcoder@xxxxxxx> wrote:
>
> When the return type is set to oracle.date, there are hours, minutes, and
> seconds of the date value in the SQL execution result.
> Why is there such a difference and how to solve it?

orafce defines oracle.date as timestamp(0) [0] because Oracle's DATE type has
a precision of one second [1].  That's the point of orafce: to provide Oracle
compatibility.

You can cast oracle.date to pg_catalog.date but then you're in Postgres
territory again.  Depends on what you want to achieve.  If it's just formatting
use oracle.to_char:

	SELECT oracle.to_char('2023-04-27'::oracle.date, 'YYYY-MM-DD');

[0] https://github.com/orafce/orafce/blob/VERSION_3_24_4/orafce--3.24.sql#L343
[1] https://oracle-base.com/articles/misc/oracle-dates-timestamps-and-intervals#date

--
Erik





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux