fix: Make recursive view parsing work with XMLTABLE + DEFAULT

This commit is contained in:
Wolfgang Walther
2022-06-03 22:19:16 -05:00
committed by Steve Chavez
parent eedfe957b5
commit 7db4a75146
3 changed files with 27 additions and 6 deletions
+18
View File
@@ -2462,3 +2462,21 @@ BEGIN
INSERT INTO deferrable_unique_constraint VALUES (1), (1);
END$$;
-- This view is not used in any requests but just parsed by the pfkSourceColumns query.
-- XMLTABLE is only supported from PG 10 on
DO $do$
BEGIN
IF current_setting('server_version_num')::INT >= 100000 THEN
CREATE VIEW test.xml AS
SELECT *
FROM (SELECT ''::xml AS data) _,
XMLTABLE(
''
PASSING data
COLUMNS id int PATH '@id',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified'
);
END IF;
END
$do$;