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

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: date type changing to timestamp without time zone in postgres 9.4
Дата
Msg-id 556B1BE9.20204@aklaver.com
обсуждение исходный текст
Ответ на date type changing to timestamp without time zone in postgres 9.4  (Rishi Gokhale <rgokhale@bjondinc.com>)
Ответы Re: date type changing to timestamp without time zone in postgres 9.4
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Re: 9.4.1 -> 9.4.2 problem: could not access status of transaction 1
Следующее
От: Arup Rakshit
Дата:
Сообщение: JSONB matching element count