Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgEUI-0002Az-Nr for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2020 21:30:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jgEUG-0007Ip-CD for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2020 21:30:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgEUG-0007Ih-2U for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2020 21:30:20 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jgEUD-0000Fi-6g for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2020 21:30:19 +0000 Received: by mail-qk1-x744.google.com with SMTP id c185so14224qke.7 for ; Tue, 02 Jun 2020 14:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=iDDMIVuvn7EOu1/QHVh9SpfrTKJLnuZxskZK6+rkuW4=; b=vVSZdMs/fndqDOrgOqgR8mLDn4nrdrEWp/ZaynZnWY3PmfVBFmYYL/oTB8WfWj6qbb 4JUt6MuEqlRTe4vGmq0A/NIyqBw0Bb3GjhWDJvW+thX251Es25Yh7Pgi+AYxgIHmF+Nl ETyFMRqGEboCAlihXQcA+xar7GOcVWgb/6phz/k/bq/9CgULvgGL24JR04Y1gV3wjGhz 9D6nFykfvORstodzu/MFyPGGQP7a5LKDyvUQElLSjEyPX2KwOuUI4xlzTenqi2QbYvAF ognVxwPfttQMMohQVeaTh8eUTOHOOjJslsoIJ5dHQ6uEosjZa6av3URCr+OuvAWWxREI brFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=iDDMIVuvn7EOu1/QHVh9SpfrTKJLnuZxskZK6+rkuW4=; b=US9YelErtDYqKGmN1yftvqzO8p0vx1ukmZtjv5jAWUsX+2hbRveeYeswJEaf+3mN1A XpqOTgc467OhPOpi1r4/t/fb9cr9jd0GxTpjLCrjThr0GKMhJBQGwDtHROrV0IlDkgx2 KjTCMTqs+ejwmYzkMCwrdPQV9qCshMSYlApEQo1kNZoV8Ga8sQjvdwSy86qcbh5N4Bx7 wMwDcYzWrBvmJ9ODSjndUjXZLv1QlwKnLhhzEguiQtpcFvceg2f8RYgsie9wvi2Rphwy 9rCcyUcRcl9t500rLAag/TVj+8L0Q0Uw34HIJd6XLwSDW7vZwt3pajFKWPj65G54z0ZC 5LrQ== X-Gm-Message-State: AOAM533R3OOjIZIukoUWO46jC6MRTxJmEuPRlEW6iMIa4o60K9WLaC78 KaP6G5V84opNUlJ1u7crpQhqiQ== X-Google-Smtp-Source: ABdhPJzOly3B0HA9V/urjvEqclhBJgBSWezlVLGnyGisHlzWYXpx0trYfKG1o38ks5UJnSGZEy043Q== X-Received: by 2002:a37:ef12:: with SMTP id j18mr25310447qkk.306.1591133415557; Tue, 02 Jun 2020 14:30:15 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id g132sm3360562qkb.78.2020.06.02.14.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 14:30:15 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 505DC3007F0; Tue, 2 Jun 2020 17:30:03 -0400 (-04) Date: Tue, 2 Jun 2020 17:30:03 -0400 From: Alvaro Herrera To: Thomas Munro Cc: Manuel Rigger , PostgreSQL mailing lists Subject: Re: FailedAssertion("!OidIsValid(def->collOid)", File: "view.c", Line: 89) Message-ID: <20200602213003.GA20290@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Dec-02, Thomas Munro wrote: > On Mon, Dec 2, 2019 at 12:32 PM Manuel Rigger wrote: > > CREATE TABLE t0(c0 TEXT COLLATE "POSIX"); > > CREATE VIEW v0(c0) AS (SELECT (t0.c0 COLLATE "C")::INT FROM t0); -- > > FailedAssertion("!OidIsValid(def->collOid)", File: "view.c", Line: 89) > > > > When building without assertions, the CREATE VIEW statement results in > > an error instead: > > > > ERROR: collations are not supported by type integer > > I think the options are to add a check and ereport() instead of an > assertion, or just remove the assertion and let BuildDescForRelation() > report the error as it does in non-assert builds. I think the latter > is better, since it seems well established that BuildDescForRelation() > will complain about that via its call to GetColumnDefCollation(). > Here's a patch to do that. This has not been applied yet AFAICS. Thomas, are you getting to this one soon? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services