Postgresql CREATE TABLE AS fails with timestamp columns
See original GitHub issueWhen trying to use CREATE TABLE postgres_catalog.schema.table_name AS SELECT timestamp_column from another_pg_catalog.schema.table
Presto throws an error.
Query 20170405_151901_00163_hzzb8, FAILED, 3 nodes
Splits: 52 total, 34 done (65.38%)
0:02 [1 rows, 0B] [0 rows/s, 0B/s]
Query 20170405_151901_00163_hzzb8 failed: Batch entry 0 INSERT INTO "postgres"."my_schema"."tmp_presto_88aa4cf1e3724dd5a45010ab786fd074" VALUES (1443814801104) was aborted. Call getNextException to see the cause.
When I go into the target Postgres logs to see more detail the error seems to be that its trying to insert a bigint instead of a timestamp.
2017-04-05 15:19:03.740 GMT,...,"PARSE",...,ERROR,42804,"column ""created_date"" is of type timestamp without time zone but expression is of type bigint",,"You will need to rewrite or cast the expression.",,,,"INSERT INTO ""postgres"".""my_schema"".""tmp_presto_88aa4cf1e3724dd5a45010ab786fd074"" VALUES ($1)",88,,"
Not sure if I’m doing something wrong but I appear to have this issue when trying to CREATE TABLE _ AS SELECT ..
with any timestamp column in the select.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:15 (2 by maintainers)
Top Results From Across the Web
Documentation: 15: CREATE TABLE - PostgreSQL
A data row inserted into the table is routed to a partition based on the value of columns or expressions in the partition...
Read more >how to specify format of timestamp while creating table in ...
I guess I have to specify the timestamp format while creating table so that it can accept the input in "YYYYMMDDHHMMSS" format. Any...
Read more >PostgreSQL CREATE TABLE
This tutorial shows you how to use the PostgreSQL CREATE TABLE statement to create new tables. ... Third, specify a comma-separated list of...
Read more >postgresql - Formatting Timestamp in Default Constraint
Can you format a TIMESTAMP WITH TIME ZONE column in a CREATE TABLE default constraint in Postgres v10.x? ... However, according to the...
Read more >CREATE TABLE - Amazon Redshift
The data type of a distribution key column can be: BOOLEAN, REAL, DOUBLE PRECISION, SMALLINT, INTEGER, BIGINT, DECIMAL, DATE, TIME, TIMETZ, TIMESTAMP, or ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello, any news about this? I am using Presto 0.227 and PostgreSQL 10.6 and still getting the same issue reported by others here.
Thanks!
Then you must be using PrestoSQL, not PrestoDB?