aman jain
aman jain

Reputation: 1

In pgloader loading csv file and i want to skip a row from file if specific column value is null

Loading csv file in pgloader using load file and I want to skip rows based on column condition for example if specific column value is null then i want to skip that row

Not able to get the approach how to do that in pgloader please help me thankyou in advance.

Upvotes: -1

Views: 143

Answers (1)

Muhammad Usman Khan
Muhammad Usman Khan

Reputation: 1

You need to add materialize view and it will be migrated to postgres. Demo script is as follows:

LOAD DATABASE FROM mysql://root:admin@localhost/test_db INTO postgresql://postgres:admin@localhost:5428/test_db

WITH include drop, create tables, create indexes, reset sequences, foreign keys

SET maintenance_work_mem to '128MB', work_mem to '12MB', search_path to 'public'

CAST type datetime to timestamptz using zero-dates-to-null, type date drop default drop not null using zero-dates-to-null

MATERIALIZE VIEWS filtered_peoples

BEFORE LOAD DO $$ CREATE SCHEMA IF NOT EXISTS public; $$;

Upvotes: -1

Related Questions