Re: Expression of check constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dirk Mika <Dirk(dot)Mika(at)mikatiming(dot)de>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Expression of check constraint
Date: 2019-07-04 14:45:17
Message-ID: 29034.1562251517@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dirk Mika <Dirk(dot)Mika(at)mikatiming(dot)de> writes:
> 3. The column ratified is of type character varying(1). Why is it casted to text?

Type varchar in Postgres is a poor stepchild without any operators
of its own. Text is the "native" string type and any comparison etc
will require casting varchar to text first. It happens that the
expression decompilation code will show you those implicit casts
explicitly, but they don't really mean much.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ashwini Singh 2019-07-04 14:48:42 PostgreSQL upgrade from 9.4.2 to 9.6.12
Previous Message Tom Lane 2019-07-04 14:38:42 Re: Error: rows returned by function are not all of the same row type