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
@Cito Hi~ Do we have a plan to refactor the function of connect() in pgdb.py? Since the semantics and parameter settings of this function are weird and ambiguous.
For example, the DSN string can't support adding a port to it, cause the format must be 'host:base:user:passwd:opt', we can just add a port to the named parameter host using IP:PORT.
And if we use both DSN and named parameters, there will be mutual coverage. From the current code point of view, named parameters will override the value in DSN.
From my experience, it's better to make the function semantics clearer, just like pymysql.connect:
This is really a bug of the Python Package PyGreSQL,
see issue: PyGreSQL/PyGreSQL#77
As a workaround, let's modify GPDB's code to manually
escape before passing args to pgdb.
Reproduce Steps
First go to Postgres to create a database:
Then run the following python code:
The strange thing is:
RCA
[4] pass
port=5432
as kwarg, so it will enter this line of code https://github.com/PyGreSQL/PyGreSQL/blob/master/pgdb.py#L1721, and here it only escape dbname when there is space in dbname.And the
dbname
variable here is confusing, it will also add port in the string.The text was updated successfully, but these errors were encountered: