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.kla...@aklaver.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to