You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several methods of PyGreSQL, such as copy_*() or inserttable(), expect table names as parameters, and these are escaped internally.
This causes a problem when we want to specify a schema name together with the table name, like public.table, because the dot will be escaped as well. As a pragmatic solution, we now split a dotted table name and escape the parts individually. However, this only works as long as we have no tables that actually contain a dot.
For a proper solution, we could allow passing a tuple of (namespace, table) or (table,) or (db,namespace,table) instead of a string, and then escape the strings in these tuples individually before joining them. This should be handled consistently in all of the methods.
Alternatively, take a kwarg which would indicate that the table is already quoted (and might contain schema), or add separate parameters for schema and database.
The text was updated successfully, but these errors were encountered:
See earlier discussions in #47 and #61.
Several methods of PyGreSQL, such as
copy_*()
orinserttable()
, expect table names as parameters, and these are escaped internally.This causes a problem when we want to specify a schema name together with the table name, like
public.table
, because the dot will be escaped as well. As a pragmatic solution, we now split a dotted table name and escape the parts individually. However, this only works as long as we have no tables that actually contain a dot.For a proper solution, we could allow passing a tuple of (namespace, table) or (table,) or (db,namespace,table) instead of a string, and then escape the strings in these tuples individually before joining them. This should be handled consistently in all of the methods.
Alternatively, take a kwarg which would indicate that the table is already quoted (and might contain schema), or add separate parameters for schema and database.
The text was updated successfully, but these errors were encountered: