Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An incorrect generation of parameter list for "CREATE SUBSCRIPTION" in Subscription class #220

Open
dmitry-lipetsk opened this issue Mar 16, 2025 · 0 comments

Comments

@dmitry-lipetsk
Copy link
Collaborator

Documentation says - subscription_parameters must be enumerated through 'comma' symbol:

https://www.postgresql.org/docs/current/sql-createsubscription.html

CREATE SUBSCRIPTION subscription_name
    CONNECTION 'conninfo'
    PUBLICATION publication_name [, ...]
    [ WITH ( subscription_parameter [= value] [, ... ] ) ]

Subscription class does it with 'space' symbol:

testgres/testgres/pubsub.py

Lines 136 to 142 in bab1d8e

query = (
"create subscription {} connection '{}' publication {}").format(
name, options_string(**conninfo), self.pub.name)
# additional parameters
if params:
query += " with ({})".format(options_string(**params))

See options_string function:

testgres/testgres/utils.py

Lines 265 to 266 in bab1d8e

def options_string(separator=u" ", **kwargs):
return separator.join(u"{}={}".format(k, v) for k, v in iteritems(kwargs))

Plan

  • Create the tests
  • Fix a problem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant