Re: cast to domain with default collation issue.

2022-06-14 Thread Tom Lane
"David G. Johnston" writes: > On Tue, May 24, 2022 at 7:42 AM Tom Lane wrote: >> Perhaps we could improve matters like this? >> -specified, the underlying data type's default collation is used. >> +specified, the domain has the same collation behavior as its >> +

Re: cast to domain with default collation issue.

2022-06-09 Thread David G. Johnston
On Tue, May 24, 2022 at 7:42 AM Tom Lane wrote: > I wrote: > > Perhaps this should be documented more clearly, but it's not obviously > > wrong. If the domain declaration doesn't include an explicit COLLATE > > then casting to the domain doesn't create an explicit collation > > requirement.

Re: cast to domain with default collation issue.

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, jian he wrote: > > I personally feel wording *non-default* may not be that correct. Because > if the column is text then it automatically at least has default collation. > Non-default means “a value that is not the default value”. David J.

Re: cast to domain with default collation issue.

2022-05-25 Thread jian he
postgresql 15 manual parts: 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. > For example,

Re: cast to domain with default collation issue.

2022-05-25 Thread David G. Johnston
Please don’t top-post. On Tuesday, May 24, 2022, jian he wrote: > > 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 >>

Re: cast to domain with default collation issue.

2022-05-24 Thread jian he
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

Re: cast to domain with default collation issue.

2022-05-24 Thread Tom Lane
I wrote: > Perhaps this should be documented more clearly, but it's not obviously > wrong. If the domain declaration doesn't include an explicit COLLATE > then casting to the domain doesn't create an explicit collation > requirement. (That is, the domain *doesn't* have a specific > collation

Re: cast to domain with default collation issue.

2022-05-23 Thread Tom Lane
"David G. Johnston" writes: > On Monday, May 23, 2022, jian he 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" > My reading of the docs say this is consistent

Re: cast to domain with default collation issue.

2022-05-23 Thread David G. Johnston
On Monday, May 23, 2022, jian he 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

cast to domain with default collation issue.

2022-05-23 Thread jian he
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