trouble with moving data from PostgreSQL to Vertica
NickName:feygin Ask DateTime:2015-09-21T21:34:29

trouble with moving data from PostgreSQL to Vertica

I want to move some tables from PostgreSQL to Vertica, but having trouble with saving column's types as they were. After moving table to Vertica all my columns' types are VARCHAR. To copy table from PostgreSQL I use

SET DATESTYLE TO 'ISO';
COPY (select * from table_name) TO '/tmp/file_name.csv' WITH CSV HEADER;

To copy table to Vertica I use:

SET DATESTYLE TO 'ISO';
CREATE FLEX TABLE M.TABLE_NAME();
COPY M.TABLE_NAME FROM '/tmp/file_name.csv' PARSER FDELIMITEDPARSER (delimiter=',');
SELECT COMPUTE_FLEXTABLE_KEYS('M.TABLE_NAME');
SELECT COMPUTE_FLEXTABLE_KEYS_AND_BUILD_VIEW('M.TABLE_NAME');
CREATE TABLE M.TABLE_NAME_NORMAL_TABLE AS SELECT * FROM M.TABLE_NAME_view;

What am I doing wrong?

Copyright Notice:Content Author:「feygin」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/32696653/trouble-with-moving-data-from-postgresql-to-vertica

More about “trouble with moving data from PostgreSQL to Vertica” related questions

trouble with moving data from PostgreSQL to Vertica

I want to move some tables from PostgreSQL to Vertica, but having trouble with saving column's types as they were. After moving table to Vertica all my columns' types are VARCHAR. To copy table from

Show Detail

Migrate/copy data from postgres to vertica

I'm trying to migrate/copy data from postgres to vertica using python3 (if there are also other user-friendly ways, I'd be glad to hear them). Problem is that the code below works only when I copy a

Show Detail

write UUID in Vertica with jooQ

I don't have jOOQ generated classes, so, I want to use my class and write it to vertica. Table<Record> table = DSL.table(DATA_TABLE_NAME); for (Data d : data) { dsl.

Show Detail

import data from vertica to hive

I try to upload data from Vertica to Hive by using Sqoop. I can see that it creates a file and a table on HIVE, but when i try to select the data from the HIVE or from the file i cannot see the dat...

Show Detail

Copying Vertica Schema or all tables in a schema from one physical cluster to another physical Cluster

I am trying to export and import Vertica schema from one physical cluster to another physical cluster. My Test instance has one single cluster and my production instance has 3 clusters. I explored

Show Detail

Vertica different calculations than in PostgreSQL

I have one query: SELECT CAST(((stats.ts_spawn - 1427835600) / 86400) * 86400 + 1427835600 AS INTEGER) AS anon_1 FROM stats WHERE stats.ts_spawn > 1427835600 AND stats.ts_spawn < 1428440399

Show Detail

Data Import from Kafka to Vertica (vkconfig Kafka connector)

I know Vertica has vkconfig to import data from Kafka. However, it seems like Confluent also has a connector that does the same. As their web site states: "Vertica Sink Connector for Confluent

Show Detail

How to send data from S3 to vertica using IAM ROLE?

I have a requirement of moving data from aws s3 to vertica using aws roles. I have created a table with admin user and created a policy with s3 full access , attached it to our vertica role and th...

Show Detail

Query Parquet data through Vertica (Vertica Hadoop Integration)

So I have a Hadoop cluster with three nodes. Vertica is co-located on cluster. There are Parquet files (partitioned by Hive) on HDFS. My goal is to query those files using Vertica. Right now what...

Show Detail

Unable to Export Data to from R to Vertica

It will be Great if anyone an help me out with COPY function syntax. I am trying to copy data from google Doc to vertica with the help of r (using google-sheets and RJDBC Package). I have exporte...

Show Detail