pgcat icon indicating copy to clipboard operation
pgcat copied to clipboard

unrecognized configuration parameter "shard"

Open DeoLeung opened this issue 1 year ago • 3 comments

Describe the bug if sharding regex is set, set shard command is not working

To Reproduce upgrade to v1.0.0 set config

sharding_key_regex = '/\* sharding_key: (\d+) \*/'
shard_id_regex = '/\* shard_id: (\d+) \*/'

Expected behavior set shard works together with comment sharding

DeoLeung avatar Jun 29 '23 00:06 DeoLeung

I'm facing the same issue, but in a slightly different scenario. Contrarily to @DeoLeung I didn't set the regex, however:

  • If I run the command like psql [..] -c "SET SHARD TO '1'; SELECT [..]" I get the very same error.
  • If instead, I get into the psql CLI, and then from there I run SET SHARD TO '1'; it works properly.

marcodellemarche avatar Nov 07 '23 21:11 marcodellemarche

Is psql starting a transaction for you? SET SHARD TO must be sent outside explicit transactions (i.e. created with BEGIN)

levkk avatar Nov 07 '23 22:11 levkk

@levkk sorry fot the late reply, but I think you got the point. Thanks!

marcodellemarche avatar Nov 23 '23 18:11 marcodellemarche