Re: date type changing to timestamp without time zone in postgres 9.4

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Rishi Gokhale <rgokhale(at)bjondinc(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: date type changing to timestamp without time zone in postgres 9.4
Date: 2015-05-31 14:34:17
Message-ID: 556B1BE9.20204@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/30/2015 10:05 PM, Rishi Gokhale wrote:
> When I create a table with a column whose type is date the type gets
> forced to timestamp without timezone after it gets created
>
>
> ops=# CREATE TABLE test (
>
> ops(# name varchar(40) NOT NULL,
>
> ops(# start date NOT NULL
>
> ops(# );
>
> CREATE TABLE
>
> ops=# \d test;
>
> Table "public.test"
>
> Column | Type | Modifiers
>
> --------+-----------------------------+-----------
>
> name | character varying(40) | not null
>
> start | timestamp without time zone | not null
>
>
> ops=#
>
>
> The table creation is just a test, my original issue is while restoring
> a backup (pg_dump/pg_restore) from another server also 9.4, where the
> date types on numerous columns get forced to change to timestamp without
> timezone.
>
>
> Any help would be appreciated.

Not seeing that here:

test=# select version();
version

-----------------------------------------------------------------------------------------------------------------------------
PostgreSQL 9.4.2 on i686-pc-linux-gnu, compiled by gcc (SUSE Linux)
4.8.1 20130909 [gcc-4_8-branch revision 202388], 32-bit
(1 row)

test=# create table date_test(dt_fld date);
CREATE TABLE

test=# \d date_test
Table "public.date_test"
Column | Type | Modifiers
--------+------+-----------
dt_fld | date |

Sure someone has not overridden the date type in your installation?
See what \dT or \dD return?

>
>
> Thanks,
>
> Rishi
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arup Rakshit 2015-05-31 15:57:12 Postgresql 9.4 upgrade openSUSE13.1
Previous Message Arup Rakshit 2015-05-31 14:07:14 JSONB matching element count