View Issue Details

IDProjectCategoryView StatusLast Update
0000654Pgpool-IIBugpublic2020-11-19 14:27
Reporterfrtewewhe Assigned Topengbo  
PriorityhighSeverityblockReproducibilityalways
Status closedResolutionopen 
Product Version4.1.0 
Target Version4.1.5Fixed in Version4.1.5 
Summary0000654: pool_send_and_wait: Error or notice message from backend: message: "syntax error at or near "DO""
Description2020-10-14 20:22:43: pid 14: LOG: pool_send_and_wait: Error or notice message from backend: : DB node id: 1 backend pid: 117151 statement: "INSERT INTO "vault_ha_locks" AS "t"("ha_identity", "ha_key", "ha_value", "valid_until") VALUES ($1,$2,$3, ("pg_catalog"."timestamptz"('2020-10-14 20:22:43.66427+00'::text)+ ($4*'1 seconds'::interval ) )) ON CONFLICT ( "ha_key" ) WHERE DO UPDATE SET ("ha_identity", "ha_key", "ha_value", "valid_until") = ($1,$2,$3, ("pg_catalog"."timestamptz"('2020-10-14 20:22:43.66427+00'::text)+ ($4*'1 seconds'::interval ) )) WHERE ( ( ("t"."valid_until"<"pg_catalog"."timestamptz"('2020-10-14 20:22:43.66427+00'::text) ) AND ("t"."ha_key"=$2 )) OR ( ("t"."ha_identity"=$1 ) AND ("t"."ha_key"=$2 )))" message: "syntax error at or near "DO""
Steps To Reproducehashicorp vault with storage backend as postgres

https://github.com/hashicorp/vault/blob/master/physical/postgresql/postgresql.go
(ctrl+f: on conflict)
TagsNo tags attached.

Activities

pengbo

2020-10-15 11:28

developer   ~0003586

It seems a bug. I will look into it.

pengbo

2020-10-15 17:48

developer   ~0003587

Could you share the original query executed by your application?

frtewewhe

2020-10-19 20:48

reporter   ~0003588

It's not my code.

Query is concatenated by that code
https://github.com/hashicorp/vault/blob/e9c763164ec6c1c93e477a3b7a52c782e9583cdf/physical/postgresql/postgresql.go#L181

Values are described in comment


Initia sql:

CREATE TABLE IF NOT EXISTS vault_kv_store (
  parent_path TEXT COLLATE "C" NOT NULL,
  path TEXT COLLATE "C",
  key TEXT COLLATE "C",
  value BYTEA,
  CONSTRAINT pkey PRIMARY KEY (path, key)
);

CREATE INDEX IF NOT EXISTS parent_path_idx ON vault_kv_store (parent_path);

CREATE TABLE IF NOT EXISTS vault_ha_locks (
  ha_key TEXT COLLATE "C" NOT NULL,
  ha_identity TEXT COLLATE "C" NOT NULL,
  ha_value TEXT COLLATE "C",
  valid_until TIMESTAMP WITH TIME ZONE NOT NULL,
  CONSTRAINT ha_key PRIMARY KEY (ha_key)
);

pengbo

2020-11-17 12:54

developer   ~0003598

Thank you for reporting this bug.

Bug is fixed.
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=94cbceb35c97817a7bc356fc52db77e199913a39

Will be released in the next minor release.

administrator

2020-11-19 14:26

administrator   ~0003600

4.1.5 released.
Close issue.

Issue History

Date Modified Username Field Change
2020-10-15 05:25 frtewewhe New Issue
2020-10-15 11:28 pengbo Note Added: 0003586
2020-10-15 11:29 pengbo Assigned To => pengbo
2020-10-15 11:29 pengbo Status new => assigned
2020-10-15 17:48 pengbo Note Added: 0003587
2020-10-19 20:48 frtewewhe Note Added: 0003588
2020-11-17 12:54 pengbo Note Added: 0003598
2020-11-17 12:54 pengbo Status assigned => resolved
2020-11-17 12:54 pengbo Target Version => 4.1.5
2020-11-19 14:26 administrator Note Added: 0003600
2020-11-19 14:27 administrator Status resolved => closed
2020-11-19 14:27 administrator Fixed in Version => 4.1.5