Re: cast to domain with default collation issue.

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: cast to domain with default collation issue.
Date: 2022-05-25 05:58:28
Message-ID: CACJufxEp2aLbQFxsErTvh11x+GnouXEKKbdFUEHZUztYwWryLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Otherwise, all input expressions must have the same implicit collation
> derivation or the default collation. If any non-default collation is
> present, that is the result of the collation combination. Otherwise, the
> result is the default collation.
>

I think the above quote part can be used to explain the following
examples.

> CREATE TABLE test1 ( a text COLLATE "de_DE", b text COLLATE "es_ES", c
> text );
> SELECT a < 'foo' FROM test1;

SELECT c < 'foo' FROM test1;

But the *non-default* seems not that correct for me. Like a column if
it does not mention anything, then the default value is null. So
* create table test111( a tex*t) The default collation for column a is
the same as the output of *show lc_collate*.

so there is no *non-default? *

On Tue, May 24, 2022 at 10:43 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Monday, May 23, 2022, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
>> CREATE DOMAIN testdomain AS text;
>>
>> --asume the default collation is as per show LC_COLLATE;
>>
>> – on my pc, it is C.UTF-8.
>>
>> --So the testdomain will be collation "C.UTF-8"
>> ------------
>>
>> => \d collate_test1
>>
>> Table "test.collate_test1"
>>
>> Column | Type | Collation | Nullable | Default
>>
>> --------+---------+-----------+----------+---------
>>
>> a | integer | | |
>>
>> b | text | en-x-icu | not null |
>>
>> -----------------------------------------------
>>
>> My guess is that the following should be the same.
>>
>>
>>
> My reading of the docs say this is consistent with outcome #2.
>
> https://www.postgresql.org/docs/current/collation.html
>
> David J.
>
>

--
I recommend David Deutsch's <<The Beginning of Infinity>>

Jian

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2022-05-25 06:38:24 Re: cast to domain with default collation issue.
Previous Message Amit Kapila 2022-05-25 04:09:16 Re: How is this possible "publication does not exist"