Skip to content

Commit

Permalink
[physical][postgresql] concat|| operator (#2945)
Browse files Browse the repository at this point in the history
Use `||` standard concatenation instead of the `concat` function in
order to use the `vault_kv_store` index on `parent_path`.
  • Loading branch information
yannmh authored and jefferai committed Jul 2, 2017
1 parent 5d2d750 commit ead553d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion physical/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func newPostgreSQLBackend(conf map[string]string, logger log.Logger) (Backend, e
delete_query: "DELETE FROM " + quoted_table + " WHERE path = $1 AND key = $2",
list_query: "SELECT key FROM " + quoted_table + " WHERE path = $1" +
"UNION SELECT DISTINCT substring(substr(path, length($1)+1) from '^.*?/') FROM " +
quoted_table + " WHERE parent_path LIKE concat($1, '%')",
quoted_table + " WHERE parent_path LIKE $1 || '%'",
logger: logger,
}

Expand Down

0 comments on commit ead553d

Please sign in to comment.