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 1vdVOX-001Sqt-2p for pgsql-general@arkaria.postgresql.org; Wed, 07 Jan 2026 15:24:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vdVOW-00Eh0m-2e for pgsql-general@arkaria.postgresql.org; Wed, 07 Jan 2026 15:24:21 +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 1vdVOV-00Eh0e-36 for pgsql-general@lists.postgresql.org; Wed, 07 Jan 2026 15:24:21 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vdVOT-0056HH-1M for pgsql-general@postgresql.org; Wed, 07 Jan 2026 15:24:20 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id CBDAF1D000BB; Wed, 7 Jan 2026 10:24:14 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 07 Jan 2026 10:24:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1767799454; x=1767885854; bh=scq5Gi0hGt03KX4K/ZawzlEIAbUaL+BcZl89vYSiZYE=; b= kR4crMMiZC3Tw6Ej54O+Yo2RKGq6h2VqrgUj3JGZaglEB/bJkAIjbRBtqhg0A/wc dLP1v2rwyHZT4LpBOokxITLQ5n04/ya+mRhP4E7btSXvgOqFHMQ70B4+GO5yAixJ MYaaLslV1MGmbbVOgn1zhxKes/9LAepE7LTTceTI7ngasR0bI/MUMZQO+sT8q2NC 4RJWr3KRJm5g3iCaCeI5uvNarc7QEdPUkg3S+PvgYT5/386jJoyqOGjEg9XBQ757 YJ1EpLp5ZEyT2mITznyNEBLvn2QEbwaDk4USWXII92TS8qIHXvETWldTaw9aVFJg RO/kB9HT/t6cUO+2vwDI/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1767799454; x=1767885854; bh=s cq5Gi0hGt03KX4K/ZawzlEIAbUaL+BcZl89vYSiZYE=; b=w+UzlL0J2zvAIci+Q pBflnpFkrYPFIwMansLNxlckEoRV4J/ublzZnlld3Juti9vhNzg1gUT88bDbkhRB IP5RfWUtDIqcEW86TPsT9RahttlBoI1VnxhGFj5vK+EKQQ/RA0DUdGC39KBRWj/l 0x0EWuTYLvXSdQMP41yMDVX/Xe2OgthHuYmmKP+kzdQQl46fI9ZMMIU8ea4EFXfi Y9sgGTwkif9GGhXZqnvha9bfyUd6HX4xUt6cJUBEjEujfATw1R2HOdQ19q05eADH 1Q0HnkPkSykosus25to31hAJRg+V3H8l/g0WyouRKhwjO79ZDe0SdalM+5B5eweu Fk4YA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddutdefgedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpeelgeevkeekkeeuiefgtdevieeluefhfedufeetkeejffek jeeujeehgeehgeektdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhoug gvpehsmhhtphhouhhtpdhrtghpthhtohepshhtuhgrrhhtrdgtrghmphgsvghllhesrhhi uggvfihithhhvhhirgdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlse hpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jan 2026 10:24:14 -0500 (EST) Message-ID: <13cb8c5c-84f1-4bf8-983a-268969bfcc25@aklaver.com> Date: Wed, 7 Jan 2026 07:24:13 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Unexpected modification of check constraint definition To: Stuart Campbell , pgsql-general@postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/7/26 02:32, Stuart Campbell wrote: > Hi there, > > I'm working in a Ruby on Rails application where the schema is > periodically dumped to a structure.sql file on disk. So, it would be > convenient if the constraint definition was "stable" (otherwise, there's > unnecessary noise in our version control history) > > Is it expected that the second form is rewritten into the third form? It > seems a bit odd to see all the type casting going on, but maybe there is > a good reason for that. (Maybe this is an issue with using varchar > instead of text?) https://www.postgresql.org/docs/current/datatype-character.html "text is PostgreSQL's native string data type, in that most built-in functions operating on strings are declared to take or return text not character varying. For many purposes, character varying acts as though it were a domain over text." When you did the dump/restore cycles where they from and to the same Postgres version/instance? > > Regards, > Stuart > > This communication and any attachments may contain confidential > information and are intended to be viewed only by the intended > recipients. If you have received this message in error, please notify > the sender immediately by replying to the original message and then > delete all copies of the email from your systems. > > -- Adrian Klaver adrian.klaver@aklaver.com