public inbox for [email protected]  
help / color / mirror / Atom feed
Specified date type but created column is timestamp without time zone
2+ messages / 2 participants
[nested] [flat]

* Specified date type but created column is timestamp without time zone
@ 2021-11-06 19:11  Mike Elston <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Mike Elston @ 2021-11-06 19:11 UTC (permalink / raw)
  To: [email protected]

Hi

I created a table containing a column of type "date" but the
describe command reports that the created column is "timestamp without time
zone". Why isn't it simply "date"?

psql (EnterpriseDB) 13.4.8

mifis=> create table test (test_date date);
CREATE TABLE
mifis=> describe test;
                           Table "public.test"
  Column   |            Type             | Collation | Nullable | Default
-----------+-----------------------------+-----------+----------+---------
 test_date | *timestamp without time zone* |           |          |

According to https://www.postgresql.org/docs/9.1/datatype-datetime.html
date is a distinct type occupying four bytes whereas timestamp without time
zone occupies 8 bytes.

Thanks

Mike


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

* Re: Specified date type but created column is timestamp without time zone
@ 2021-11-06 19:31  Tom Lane <[email protected]>
  parent: Mike Elston <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2021-11-06 19:31 UTC (permalink / raw)
  To: Mike Elston <[email protected]>; +Cc: [email protected]

Mike Elston <[email protected]> writes:
> I created a table containing a column of type "date" but the
> describe command reports that the created column is "timestamp without time
> zone". Why isn't it simply "date"?

> psql (EnterpriseDB) 13.4.8

If you're using EDB, their server is hacked in a lot of ways to act
more like Oracle, and I think this discrepancy is one of them.
Oracle's idea of "date" corresponds more or less to our "timestamp",
so they translate.

			regards, tom lane





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


end of thread, other threads:[~2021-11-06 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 19:11 Specified date type but created column is timestamp without time zone Mike Elston <[email protected]>
2021-11-06 19:31 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox