Re: chr(3) and 3::text

From: gmail Vladimir Koković <vladimir(dot)kokovic(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>, Ken Benson <Ken(at)infowerks(dot)com>
Subject: Re: chr(3) and 3::text
Date: 2020-03-28 15:39:51
Message-ID: 473c9cab-3d3c-7bb0-bb34-51ea81f689ff@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 28.3.20. 16:25, David G. Johnston wrote:
>
> The convention here is to bottom or inline post, trimming unnecessary
> content.
>
> Its that way because :: is defined to make it that way.
>
> 3 has a type of integer
> '3' has a type of text
> ::<type> is the PostgreSQL type casting operator that casts its left
> to to <type> (see the documentation I linked to)
>
> So:
>
> integer::text == text
>
> cast(integer as text) == text
>
> is the SQL Standard equivalent expression
>
> David J.
>
integer::text == text, but which character 0x03 or 0x33 ?

Text should contain characters.

Characters is from character set.

Character 0x03 is valid in ASCII and UTF-8 character sets.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2020-03-28 16:02:26 Re: chr(3) and 3::text
Previous Message David G. Johnston 2020-03-28 15:25:52 Re: chr(3) and 3::text