Skip to content

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

Description

@dmitry-lipetsk

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions