Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBEfY-000rrS-2E for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 16:25:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBEfV-00D9nf-2Z for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 16:25:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBEfV-00D9nX-1f for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 16:25:18 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBEfU-00000000Nmm-1nqP for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 16:25:18 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-488af9fdaa7so15513205e9.1 for ; Fri, 10 Apr 2026 09:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775838313; cv=none; d=google.com; s=arc-20240605; b=gP1YnYK7pel5+gVYUip9ibTc/ufOv2/IpinB/GanoQ9eef0/3Ow/WFICr60Nr17Yn4 2isDDRuiaLoTflQtpuiI1S9K33hPzpMeYqEilkvBRW274c80ceX7LoKCpzQlnP6yNsOG 0cgq6jq5ghXoy7MoLc57P+eGyubU6WQQjZn6YaGofl5ruOGB1NBn/N653oWq1/ec0uYy 8e67io4gvlka+x1RQZ9SOV3ExuR3yckJioN6hmqQjo1FoDLkY2nXER9AEUZ1o3RU8feH FaApjjd+zTF9RQ9Ak8W78q0x79t2AdOuF8kxYS18gyqsmMXJcKXidreRcxlz1JeMPa6t Q1fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FOdiTgH5Klw9aQo8xHrGNfUYHQqMRRHamYXDz8ZHxUk=; fh=oVNqw9CRHYoenHXm+qMD6XfHmZCKdpC41i6FwsKLsNA=; b=hB/CjwxwnnOZbF1JN4Vr0SOVT5lyStDJ6q6ztE5bt6uTHRQ5ucWawFrEJvJUN7R8br jyXa0FT77WlVLiGB3/oeDisUpKXBa2SIqKQhCnG3rupnGfyiRnv3lYX1OBMkAxI6rNEz 6Iy27XkGWlFyHnGjCXQxyPfHIQHqJMZZdWC3zqaQs0WB4wZiHAG6d6rfvgIBdix5wSj/ MzRqcaZiND7ig6xnnqNpoVvOgzLs+InVeaY18aBCyllUJXEljlxBbevXhqHRRCkvopn4 cbEWXLjsyFniTFvyRZLwnht/LhRoIc7RrMNdbpINnV5PDGsdTue7zI73niy6ZxkZWJBn 2DPw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775838313; x=1776443113; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FOdiTgH5Klw9aQo8xHrGNfUYHQqMRRHamYXDz8ZHxUk=; b=GZeAMz3mexNNqrGF4cQ7jnX25rFcHNENOW0v8WUbNhW8eDT+PxSLWz2biWVm7iwlqk mbPPOtRWPi1mV9BkOtczLvWXIMoFts3vWkfJFwuBDbxGTQkn3HNXiD4gwcj5AyzmLUjv mXflvajYOcbQA4yV851ymvFn8ZFbt9xXeFQ+A1rmKbF/PIsYpY4XEMCbR4aIHM+BejDt tNMQgya7WJlccpktqi9Q5PY6rbssqIQ6+IiySeXG5B3TJgByD+1PiWIfUoGOmIv5Oo7Q PF0untVvUOWqoF8twsnUkcukaoVIPTtB8z3TRXSOLJlaELEOrI+eBEc9ePVdHkVBQ6TF 8xPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775838313; x=1776443113; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FOdiTgH5Klw9aQo8xHrGNfUYHQqMRRHamYXDz8ZHxUk=; b=sBpqZcR4+Ljw+tMT0DyVyISVWjpVP+VeuDldtUGHZ7BMWcoT0P1uVVMy7bagNba13R 4BmbGUNVxniNU2s9HAzL1+P7BKEwC19bbSIZb09V2mqiEU66IM8gw6oiIPzfSnq1k0KV mLEq8oInvRNLoZhMzX8yhdf4wny+xrGjrNz8ajY5fWcAEkj4TOTwZJw+U7ScpEnq35cE 5eP6RMYn+rIRKp0LddGVQU1DqZt55FZikho77d5rj9SUXdJsvFglacZWuvFb+0h+wVtq 1mHW0tMn2ao7Dvu7ckYF6F0Wz3P+sF8CmIRGO/nCKl3QlfQsaQ+6Pz8jmmh6Y0zd+dgJ KvYw== X-Gm-Message-State: AOJu0YzK45ZB4sVRmWgzFUTHwg0CFd8DtKbt8+Jy9rxeJnNl+ZGAJUIY 1GW2hMZkVUIjZMixW29/SwfRPeZEwuKJUhKyMRrUEYzouXwfOiJ/DUcW8aEPk+PFD9vWuk8ZteG efgibGQcB0QV1BnqiO8s5J6YFN9ISfzhuO5Ps X-Gm-Gg: AeBDievpxyJZfB1k/UewOPUA9JzNMQYZd3pL8/TEyI9YcV1wXtZpXTjfFaNVebba19v nJn2CXNB3quGgvf2wwaO9lB+yd/WvxNiIDxFK5nD+SqCFddpFuvFHmwyqonLrR34wDlWry2u/E8 08T4s4yKt409q/O/M+foeyqh4Haodz+Iblzy9rCHGTqah1ISDiSU6cp9ROtAhAwzrt18zsVXS+R M/o+RJU9KFi3FtI8CDdaExQ+EzZBRwXqOFYcdv6Sxmmaru21Xt6fRAMG8mNGvW0CTbj2pjOv9hq Q+CWDazp3DithbiVjPUSOBMnP/0vCCei0+SgL/TUAkZi6WJ81b0= X-Received: by 2002:a05:600c:4ecf:b0:486:fd5c:2b35 with SMTP id 5b1f17b1804b1-488d68685aemr51538055e9.13.1775838313168; Fri, 10 Apr 2026 09:25:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ashutosh Bapat Date: Fri, 10 Apr 2026 21:55:00 +0530 X-Gm-Features: AQROBzCCLm1vXPpLRMSeTwZPtUdcNYnUUsPUwzT3UPmV9F8wfv4zKqRSPDN499o Message-ID: Subject: Re: Bug: Missing collation assignment for GRAPH_TABLE COLUMNS expressions To: SATYANARAYANA NARLAPURAM Cc: PostgreSQL Hackers , Peter Eisentraut Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Satya, Thanks for the report and patch. On Fri, Apr 10, 2026 at 9:12=E2=80=AFPM SATYANARAYANA NARLAPURAM wrote: > > Hi hackers, > > GRAPH_TABLE COLUMNS expressions that involve collation-dependent function= s or operators fail with: > > ERROR: could not determine which collation to use for upper() function > HINT: Use the COLLATE clause to set the collation explicitly. > > Setup: > > CREATE TABLE vtx (id int PRIMARY KEY, name text); > CREATE TABLE edg (id int PRIMARY KEY, > src int REFERENCES vtx(id), > dst int REFERENCES vtx(id)); > INSERT INTO vtx VALUES (1,'Alice'),(2,'Bob'),(3,'Carol'); > INSERT INTO edg VALUES (1,1,2),(2,2,3); > > CREATE PROPERTY GRAPH g > VERTEX TABLES (vtx KEY (id)) > EDGE TABLES (edg KEY (id) > SOURCE KEY (src) REFERENCES vtx (id) > DESTINATION KEY (dst) REFERENCES vtx (id)); > > postgres=3D# SELECT * FROM GRAPH_TABLE (g > MATCH (a IS vtx)-[e IS edg]->(b IS vtx) COLUMNS (upper(a.name) AS src_u= pper)); > ERROR: could not determine which collation to use for upper() function > HINT: Use the COLLATE clause to set the collation explicitly. > > > In transformRangeGraphTable(), the COLUMNS transformation loop calls tran= sformExpr() > on each column expression but omits the subsequent assign_expr_collations= () call. Both > WHERE clause transformation sites in parse_graphtable.c correctly include= it. > > Attached a patch to fix this. I think the fix is in the right direction. It's better to call assign_expr_collation only once on all the columns at the end of loop of rgt->columns, just like assign_expr_collation is called on all the conditions in WHERE clause once. Good to see tests also included in the patch. Do we need all three queries? Also those queries should be placed near the section "-- test collation specified in the expression" and add a query for explicit collation in COLUMNs expression. --=20 Best Wishes, Ashutosh Bapat