Prem
Prem

Reputation: 5997

pgloader - how to specify schema

How can I specify the schema in the pgloader connection string? The following code works fine but fails when I add the last line.

I've tried various approaches, but one of the errors I encountered was "KABOOM! ESRAP-PARSE-ERROR: At".

LOAD DATABASE
     FROM mysql://<username>:<password>@localhost:3307/airflow
     INTO pgsql://<username>:<password>@localhost:5437/airflow
 
WITH include no drop, data only;

-- Set the schema search path
SET search_path TO your_schema;

Upvotes: 1

Views: 1768

Answers (1)

n0099
n0099

Reputation: 1393

https://github.com/dimitri/pgloader/issues/566#issuecomment-306447741

It used to be that the search_path trick was all you need here to achieve your goal, but not anymore. The way to do it in pgloader is now to use ALTER SCHEMA test_development RENAME TO public in your load command. As far as honouring the search_path setting, please run in debug mode to see the SQL statement sent for the SET environment.

https://github.com/dimitri/pgloader/issues/718#issuecomment-358435472

Upvotes: 0

Related Questions