got error when I tried copy table from postgres to databae on cockroachdb

19 views
Skip to first unread message

Sang Gyu Kim

unread,
Jan 17, 2020, 2:21:44 PM1/17/20
to CockroachDB
Hello, I tried to copy table from postgres db  to database on cockroachdb. when I tried to create table, I got error as listed below. any help or information would be greatly appreciated.


postgres=# CREATE TABLE tr(
postgres(#     uid integer NOT NULL,
postgres(#     status character varying(20) NOT NULL,
postgres(#     v_by character varying(3) NOT NULL,
postgres(#     t_id character varying(100) NOT NULL,
postgres(#     s_error_msg character varying(800),
postgres(#     cdate timestamp without time zone DEFAULT LOCALTIMESTAMP NOT NULL,
postgres(#     lupdated timestamp without time zone DEFAULT LOCALTIMESTAMP NOT NULL,
postgres(#     PRIMARY KEY(uid, t_id)
postgres(# );
ERROR:  at or near "localtimestamp": syntax error
DETAIL:  source SQL:
CREATE TABLE tr(
    uid integer NOT NULL,
    status character varying(20) NOT NULL,
    v_by character varying(3) NOT NULL,
    t_id character varying(100) NOT NULL,
    s_error_msg character varying(800),
    cdate timestamp without time zone DEFAULT LOCALTIMESTAMP NOT NULL,
                                              ^
HINT:  try \h CREATE TABLE

Thanks,

Sang

Yahor Yuzefovich

unread,
Jan 17, 2020, 4:38:45 PM1/17/20
to Sang Gyu Kim, CockroachDB
Hello Sang,

Thanks for your interest in CockroachDB!

You’re getting an error because we currently do not support “LOCALTIMESTAMP” (see https://github.com/cockroachdb/cockroach/issues/44032). However, the good news is that we currently have a PR open (https://github.com/cockroachdb/cockroach/pull/44042) to support, and probably it’ll be included in one of the next 20.1 alpha/beta releases and should be in 20.1 release coming out in April.

Best,
Yahor Yuzefovich
--
You received this message because you are subscribed to the Google Groups "CockroachDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cockroach-db+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cockroach-db/d94b802e-e7e8-4026-b6f6-621946becc24%40googlegroups.com.

Sang Gyu Kim

unread,
Jan 22, 2020, 9:46:39 AM1/22/20
to CockroachDB
Hello Yahor,

so Is there any workaround until 20.1 is released?

Thanks,

Sang
To unsubscribe from this group and stop receiving emails from it, send an email to cockro...@googlegroups.com.

Yahor Yuzefovich

unread,
Jan 22, 2020, 2:19:11 PM1/22/20
to Sang Gyu Kim, CockroachDB
Hello Sang,

I'm not very familiar with the usage of LOCALTIMESTAMP, so I'm not sure whether we have a workaround. Possibly you would need to modify your schema to not use it. Also, other folks might know better, so hopefully they will offer some guidance.

Best,
Yahor Yuzefovich

To unsubscribe from this group and stop receiving emails from it, send an email to cockroach-db...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cockroach-db/f9a23249-fd6d-4a82-95c9-9da16562967f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages