Re: Unexpected modification of check constraint definition

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Stuart Campbell <stuart(dot)campbell(at)ridewithvia(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Unexpected modification of check constraint definition
Date: 2026-01-07 15:24:13
Message-ID: 13cb8c5c-84f1-4bf8-983a-268969bfcc25@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2026-01-07 17:00:42 Re: Fwd: pg18 bug? SELECT query doesn't work
Previous Message Laurenz Albe 2026-01-07 12:57:49 Re: Unexpected modification of check constraint definition