Skip to main content

Some workspace of us is using ogr2ogr to move data from one postgres db towards another (more performant then setting up a FDW in postgres itself and more performant then FME for doing the data move).

Calling this via the system caller shows all information in the log file (including password information). Is there a way to avoid this more recent then this post: 

 

 

How about calling ogr2ogr through python instead of SystemCaller?

(i.e. python subprocess)


...or have the passwords in environment varaibles?


Thanks for the suggestions.

 

Password is rotating and is put in a key vault that I need to fetch, so making it more difficult to put it as environment variable + did a quick test and it still shows in the log.

 

Converted it to pythoncaller and there it doesn’t show in the logs.


How about calling ogr2ogr through python instead of SystemCaller?

(i.e. python subprocess)

Though struggeling with the correct command to make it work when I have the whole ogr2ogr command created upfront via attribute manager (because there are some conditionals involved). So using python caller isn’t as handy as the systemcaller.


You may be able to set an environment variable in a step before the systemcaller (again in Python) and then including that environment variable in the systemcaller. Haven’t tested that, it may be that the environment is not inherited...