0

I'm trying to understand the docs https://pgloader.readthedocs.io/en/latest/ref/pgsql.html#materialize-views. How would I make a command file for pgloader that would use this. What I have is

load database
    from pgsql://user:test@127.0.0.1:8081/db 
    into pgsql://user2:test@127.0.0.1:8082/db2 

WITH testview AS 
$$
SELECT
*
FROM data
$$;

I don't understand how to use this clause. Above example can't be parsed by pgloader.

Edit: in this example I have a data table in db and I'm just testing the materialize view of pgloader

Edit2: ok the WITH should be MATERIALIZED VIEWS

load database
    from pgsql://user:test@127.0.0.1:8081/db 
    into pgsql://user2:test@127.0.0.1:8082/db2 

MATERIALIZED VIEWS testview AS 
$$
SELECT
*
FROM data
$$;

Still getting some FATAL error: Database error 42703: column "adsrc" does not exist errors

Edit3: seems like the debian release is not updated for e.g. ubuntu-20.04 to counter this bug https://github.com/dimitri/pgloader/issues/1034 also docker image of pgloader seems to be broken I can't get it to read command file. Similar to issue https://github.com/dimitri/pgloader/issues/889

eemilk
  • 1,375
  • 13
  • 17

0 Answers0