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 1wNXtM-000tTT-2U for pgsql-bugs@arkaria.postgresql.org; Thu, 14 May 2026 15:22:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wNXtL-00DRYq-2J for pgsql-bugs@arkaria.postgresql.org; Thu, 14 May 2026 15:22:27 +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 1wNAXD-009MkC-0o for pgsql-bugs@lists.postgresql.org; Wed, 13 May 2026 14:26:03 +0000 Received: from mail-yx1-xb132.google.com ([2607:f8b0:4864:20::b132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wNAXA-00000000PcN-3Iie for pgsql-bugs@lists.postgresql.org; Wed, 13 May 2026 14:26:02 +0000 Received: by mail-yx1-xb132.google.com with SMTP id 956f58d0204a3-65c7a459105so7766196d50.0 for ; Wed, 13 May 2026 07:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778682359; cv=none; d=google.com; s=arc-20240605; b=PoUDGzzE7rgtkfk6pd+DL27J7KdTkKBfAdccVJYFkqg0oDpGEYykwLNl2+HlX1O9Al RCLPkDJQt6OOqvYycCHHuQSvB3vAmfrbnO8AQqVBomzNndoYStZgVzha/3AWPfhZ0osB Zv1n27qB1pqEccUnNUvhmr2qDL6QN8zkbskbNEoAYRZi+01W6G835vLbsw0zi6lygKEn AUU9kGvYP5Ix/6XwKdCjDprmfwPAn8XgKH0VoaGb1yUnTdCXuknlKjvv2j+o4Zct6MO/ 2OKUuPSh9lhPL2MZWsq7UcKvOS2et5kMwnQ8NDaZKELM08IA8xSp1soztEiAVwgKY+cC tTbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=aug4KHIuuFlERQ9vf69xt4WR5PXEcOga5EF+ffGvxsE=; fh=0RDAXHk0yJemOdK3Y7Q+L7ZRcOlW4zFkln66KQzlzk8=; b=AvE5imqTNuKiQbY4ixhOPcrd8f2+6mkh51TyC/jRWQ9wRCbO7SozKSQKGPOseBGZA6 n/DiQkYjI95mSZ50iygecVm7Q1lkwlbsEc6jgEnPUxHzpNrIAUD80YvoluPhnZ+tVYae BjrVO4/JkqnAnNNmMmNjz4gOa8ZA1EtI087Eo3rH4QgqHHm9ynlkXhDDNx+dPva7dlzu CjuqXmvXj3JdlnROu1o8ToeFXY8JUSeJJROwny2wPLz814PGkMVk39eHsbe4omntM7eW Q/wDQFkj4oLnYOhlMb1t2SX//4tN+aT45P9rxlHTfjA8xWuIOvemUbSDq6AEYoxHleIn uG+w==; 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=1778682359; x=1779287159; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aug4KHIuuFlERQ9vf69xt4WR5PXEcOga5EF+ffGvxsE=; b=PpnJpyguYvPpfF8RRYLQA1TBA9ZovbNXP5FiYKIk2JHBD3GAtZD3AaYRZns0+MHsT+ yZGCzMRi2yTngo9wwpVHNwTCP89PNk07jippaCfoJba+HYIKZgj6faeBdjTyIAW/Cu1p rKx+rNrU8gf6S8iBn1qSkUcLybaaOM14sTU3sVzzSNEFNcYpeBpuGhrb+dyS1+97oLCA 1R0B/ihBkdz2B5zMC54I0tys/AitLp0u7KvD/1QUyn7u9Mys+FbaPf5syo42szwFGCnW kgNH0Lh11B1mogzp9BuDaQ3JlCCVBJOiwuo1xELGsmQKjP81x+eWXm3m6NgIqiBPlw1m RlYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778682359; x=1779287159; h=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=aug4KHIuuFlERQ9vf69xt4WR5PXEcOga5EF+ffGvxsE=; b=kNhsxlexzjOlO8LD/6Jp8sjadKKFCRTOESbqPGrAwvdvZg4vzKDd0ZWhIkDrBUVkNw brbrQ46GPOuaxL0oAUsQILQ+LA6BRgEeX39tx9Cj5za/4uGZ3lYJyOOlYiioO4PbivI5 NGHSbfUxews0ULr9C7ePMZqF44U5e8gE29Z0m4yNgksf7T3WRo8FmDYl0ZNUz1xzCfWD k/dT2kUxkEhkA5dlHqYPncI8X7nzxKaYscg2spduOmPBG7TGXdyFf4A8ikP3aKMeJJzM lm+RKJDisIOqjYv1zUbux91QTXx7EcN3WKE8zel4k4loYgb4qSgwOuHQMEWz+YzTqRlG ypeQ== X-Gm-Message-State: AOJu0Yz2UhbUEd+o/ZVZsjFngYScU8TdVhHZ66jVLliN3LBDIcl/zUuo Mqq/52ejqqG5pNsi7DNgxzMHy1xSSWzYVlzgY99ftzLDcE2W5P+U+9fIyHWHuCWdcunQgQZ4uQB HU0R1W4wxLxrr/4G+6y8Oehy3nri5ig+3Pwn2 X-Gm-Gg: Acq92OE+pVXwmHwzwoaf03m/z9RCuKz/WSx+L2aX8hffLzFqix7XJQdWF6bKgaSI2zQ kgMe/0p6ByiD/9zZetwWJxrgU00dywrXXch0xbMZs8tkF1fgdAr+6kuelPABGRKeTF8ZhN4FdFm VM6rEeLNfk8XBaT9OEiGSw8Cyfy7A0EB9VvSWCzKwp8vfSE5dOHA1x6lWtS3kPhSdnAcUEO4Etq Nl8elL+zAzknQFFNqRsyXkneIVr0vsJ4mUvjm4c7RtsKVOUJfxJmKvsJaapnselEQR8lrZVykKh fgKqrp5deTv4g5RclJn/ERaoOPEo1ZQMq2wJ9bPXmcPLxhGN09xRdKyqRIFGwbJFPW+vMJ1V2g= = X-Received: by 2002:a05:690e:418b:b0:65c:72cb:8a6f with SMTP id 956f58d0204a3-65ddd6c0132mr6094485d50.34.1778682359022; Wed, 13 May 2026 07:25:59 -0700 (PDT) MIME-Version: 1.0 References: <165553.1778680299@sss.pgh.pa.us> In-Reply-To: <165553.1778680299@sss.pgh.pa.us> From: Marcelo Lauxen Date: Wed, 13 May 2026 11:25:47 -0300 X-Gm-Features: AVHnY4I9M_o_YmMnsHw4jSckneyKMAS3GPDWrmIlsKTibLUavj-GRcSuof40Ga0 Message-ID: Subject: =?UTF-8?B?UmU6IHBnX2dldF9pbmRleGRlZigpIG91dHB1dCBub3QgaWRlbXBvdGVudCBmb3IgcGFydA==?= =?UTF-8?B?aWFsIGluZGV4ZXMgd2l0aCBBTEwoQVJSQVlb4oCmXSk6OnRleHRbXQ==?= To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000002d894c0651b3c22c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002d894c0651b3c22c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Gotcha, it wasn't clear to me that this was never guaranteed. I will change the type of this column to text to resolve this. Appreciate the quick response! Regards, Marcelo On Wed, May 13, 2026 at 10:51=E2=80=AFAM Tom Lane wrote= : > Marcelo Lauxen writes: > > *PostgreSQL version*: 18.3 (Homebrew) on aarch64-apple-darwin24.6.0 > > *pg_get_indexdef()* produces SQL that, when executed, yields a differen= t > > pg_get_indexdef() output. This means a pg_dump =E2=86=92 pg_restore cyc= le > silently > > changes the deparsed form of partial index WHERE clauses that use NOT I= N > > (...) on a varchar column, causing cosmetic drift in tools that compare > > index definitions (e.g. ORM schema dumps, annotation generators). > > You are assuming a property that we've never guaranteed and don't plan > to start guaranteeing, ie that the output of expression decompilation > matches the input even in semantically-insignificant details. > > My own advice about how to fix this particular example is not to use > varchar --- especially not unconstrained varchar, which doesn't even > have the thin excuse of being spec-compliant. Postgres' native string > type is text. > > regards, tom lane > --0000000000002d894c0651b3c22c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Gotcha, it wasn't clear to me that this was never guar= anteed. I will change the type of this column to text to resolve this.=C2= =A0

Appreciate the quick response!=C2=A0

<= /div>
Regards,=C2=A0
Marcelo

On We= d, May 13, 2026 at 10:51=E2=80=AFAM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Marcelo Lauxen <marcelolauxen16@gmail.com> writes= :
> *PostgreSQL version*: 18.3 (Homebrew) on aarch64-apple-darwin24.6.0 > *pg_get_indexdef()* produces SQL that, when executed, yields a differe= nt
> pg_get_indexdef() output. This means a pg_dump =E2=86=92 pg_restore cy= cle silently
> changes the deparsed form of partial index WHERE clauses that use NOT = IN
> (...) on a varchar column, causing cosmetic drift in tools that compar= e
> index definitions (e.g. ORM schema dumps, annotation generators).

You are assuming a property that we've never guaranteed and don't p= lan
to start guaranteeing, ie that the output of expression decompilation
matches the input even in semantically-insignificant details.

My own advice about how to fix this particular example is not to use
varchar --- especially not unconstrained varchar, which doesn't even have the thin excuse of being spec-compliant.=C2=A0 Postgres' native st= ring
type is text.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 regards, tom lane
--0000000000002d894c0651b3c22c--