comparison sat_pubsub/pgsql_storage.py @ 483:e814c98ef07a

psql: fix `max_items` setting when creating a node
author Goffi <goffi@goffi.org>
date Fri, 23 Sep 2022 18:04:50 +0200
parents b544109ab4c4
children 97010eefdfd9
comparison
equal deleted inserted replaced
482:8bbaa089cb10 483:e814c98ef07a
284 284
285 try: 285 try:
286 cursor.execute("""INSERT INTO nodes 286 cursor.execute("""INSERT INTO nodes
287 (node, 287 (node,
288 node_type, 288 node_type,
289 access_model,
289 persist_items, 290 persist_items,
290 deliver_payloads, 291 deliver_payloads,
291 send_last_published_item, 292 max_items,
292 access_model,
293 publish_model,
294 overwrite_policy, 293 overwrite_policy,
295 serial_ids, 294 serial_ids,
296 consistent_publisher, 295 consistent_publisher,
297 fts_language, 296 fts_language,
297 send_last_published_item,
298 publish_model,
298 schema, 299 schema,
299 pep) 300 pep)
300 VALUES 301 VALUES
301 (%s, 'leaf', %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", 302 (%s, 'leaf', %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""",
302 (nodeIdentifier, 303 (nodeIdentifier,
304 config[const.OPT_ACCESS_MODEL],
303 config['pubsub#persist_items'], 305 config['pubsub#persist_items'],
304 config['pubsub#deliver_payloads'], 306 config['pubsub#deliver_payloads'],
305 config['pubsub#send_last_published_item'], 307 config[const.OPT_MAX_ITEMS],
306 config[const.OPT_ACCESS_MODEL],
307 config[const.OPT_PUBLISH_MODEL],
308 config[const.OPT_OVERWRITE_POLICY], 308 config[const.OPT_OVERWRITE_POLICY],
309 config[const.OPT_SERIAL_IDS], 309 config[const.OPT_SERIAL_IDS],
310 config[const.OPT_CONSISTENT_PUBLISHER], 310 config[const.OPT_CONSISTENT_PUBLISHER],
311 config[const.OPT_FTS_LANGUAGE], 311 config[const.OPT_FTS_LANGUAGE],
312 config['pubsub#send_last_published_item'],
313 config[const.OPT_PUBLISH_MODEL],
312 schema, 314 schema,
313 recipient.userhost() if pep else None 315 recipient.userhost() if pep else None
314 ) 316 )
315 ) 317 )
316 except cursor._pool.dbapi.IntegrityError as e: 318 except cursor._pool.dbapi.IntegrityError as e: