How to import Postgres data that has JSON columns?

0

Hi everyone,

We're interested in copying data from our Postgres database into a Redshift cluster, however we use a couple of redshift-unsupported column types in a few of our tables.

One is a bigserial (how are the rest of you handling that one?) and the really tough one to swallow is one of our columns is a JSON type.

That JSON column has a lot of important data for us. May I ask how others here are dealing with the challenge of getting that data into redshift, any recommended approaches? Thanks much.

larryq
질문됨 4년 전382회 조회
2개 답변
0

Hi larryq,

I'll refer you to the doc. page that has most of what you need here: https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html

If the PostgreSQL DB is the true source for this data then I recommend the following:

  1. BIGSERIAL -> BIGINT as they are both INT8. If you source the rows from PostgreSQL you don't need the auto generating value creation of BIGSERIAL in Redshift. Otherwise Redshift has the IDENTITY column attribute to generate values.
  2. JSON -> VARCHAR. Of course you'll have to use Redshift's JSON function to do anything with the JSON data.

Regards,
-Kurt

klarson
답변함 4년 전
0

Thanks Kurt, much appreciated.

larryq
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠