Re: date type changing to timestamp without time zone in postgres 9.4 - Mailing list pgsql-general

From Adrian Klaver
Subject Re: date type changing to timestamp without time zone in postgres 9.4
Date
Msg-id 556B1BE9.20204@aklaver.com
Whole thread Raw
In response to date type changing to timestamp without time zone in postgres 9.4  (Rishi Gokhale <rgokhale@bjondinc.com>)
Responses Re: date type changing to timestamp without time zone in postgres 9.4
List 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.klaver@aklaver.com


pgsql-general by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Re: 9.4.1 -> 9.4.2 problem: could not access status of transaction 1
Next
From: Arup Rakshit
Date:
Subject: JSONB matching element count