altaurog/pgcopy

`Replace` with table in schema other than public

rdehouss opened this issue · 5 comments

Hi,

We're using pgcopy and we would need to use the class Replace but with a table in another schema.

It fails at multiple place, including https://github.com/altaurog/pgcopy/blob/master/pgcopy/util.py#L125 and alike because of the double quotes.

Indeed, the same command without the double quotes works because postgresql can understand the schema. Otherwise, it's trying to find a table with the schema in its name in the public schema.

Another way is to do "schema"."table_name"

Could you find a way to fix that in general in pgcopy?

Thanks a lot in advance!

Cheers,

Raphaël

@rdehouss thanks for your interest in pgcopy! Schema support for Replace is something I think it definitely should provide. I’m on vacation with family right now and I don’t expect I’ll be able to look at this for a few weeks. I’ll be happy to try to do this when time permits, or if you would like to try implementing it yourself, I will gladly accept a PR. (I probably wouldn’t get to reviewing any sooner, though.)

I'll do my best to propose a PR.

PR #14 proposed

@rdehouss if this is still of interest, have a look at this branch and see if it meets your needs.

added in 1.4.0