From 3014956d94a241d509e98312bad0731ef7730007 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Mon, 2 Dec 2019 13:57:17 +1300 Subject: [PATCH] Remove assertion about collations from DefineView(). If a user has specified a collation for an expression of a type that isn't collatable, BuildDescForRelation() will raise an error further down, but until then we can't make assertions about that. Reported-by: Manuel Rigger Discussion: https://postgr.es/m/CA%2Bu7OA5TwqWTrvRoFOF1Vipf5WpfcbQYwtLGzNVXGwa6Ptor9w%40mail.gmail.com --- src/backend/commands/view.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index 9b5148093b..816b0b6299 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -85,8 +85,11 @@ DefineVirtualRelation(RangeVar *relation, List *tlist, bool replace, def->colname), errhint("Use the COLLATE clause to set the collation explicitly."))); } - else - Assert(!OidIsValid(def->collOid)); + + /* + * If it's not collatable and a collation has been provided, then + * BuildDescForRelation() will raise an error further down. + */ attrList = lappend(attrList, def); } -- 2.23.0