Specified date type but created column is timestamp without time zone

From: Mike Elston <mike(dot)elston(at)gmail(dot)com>
To: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Specified date type but created column is timestamp without time zone
Date: 2021-11-06 19:11:32
Message-ID: CAAvyBqHCrx2z4EUhSHYRNCvAj2b82=fNcmAdhCj_r3tuM_qL7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2021-11-06 19:31:18 Re: Specified date type but created column is timestamp without time zone
Previous Message Bruce Momjian 2021-11-06 17:39:19 Re: Error when pgadmin starts