Postgres: Return tables with hyphenated schemes (#45754)

* add basic test for buildSchemaConstraint function

* wrap table schema in quote_ident function

* fix type error in meta_query.test

* swap test for inline comment

* make comment more readable
This commit is contained in:
matt abrams
2022-03-03 22:56:55 -10:00
committed by GitHub
parent c331af93b9
commit 52629fbc4e

View File

@ -74,8 +74,9 @@ LIMIT 1
} }
buildSchemaConstraint() { buildSchemaConstraint() {
// quote_ident protects hyphenated schemes
const query = ` const query = `
table_schema IN ( quote_ident(table_schema) IN (
SELECT SELECT
CASE WHEN trim(s[i]) = '"$user"' THEN user ELSE trim(s[i]) END CASE WHEN trim(s[i]) = '"$user"' THEN user ELSE trim(s[i]) END
FROM FROM