Thread

  1. citext_1.out, citext.out confusing comment

    jian he <jian.universality@gmail.com> — 2025-12-09T05:07:29Z

    hi.
    
    While working on CAST DEFAULT, I found out citext_1.out, citext.out comments are
    confusing.
    
    contrib/citext/expected/citext_1.out:
    SELECT 'a'::citext >= 'B'::text AS t;  -- text wins.
     t
    ---
     f
    (1 row)
    
    
    contrib/citext/expected/citext.out:
    SELECT 'a'::citext >= 'B'::text AS t;  -- text wins.
     t
    ---
     t
    (1 row)
    
    same input, return different result,  The comment "-- text wins."
    seems confusing.
    (this happens in other places within citext.out, citext_1.out).
    
    
    
    
  2. Re: citext_1.out, citext.out confusing comment

    Kirill Reshke <reshkekirill@gmail.com> — 2025-12-09T07:30:51Z

    On Tue, 9 Dec 2025, 10:08 jian he, <jian.universality@gmail.com> wrote:
    
    > hi.
    >
    > While working on CAST DEFAULT, I found out citext_1.out, citext.out
    > comments are
    > confusing.
    >
    > contrib/citext/expected/citext_1.out:
    > SELECT 'a'::citext >= 'B'::text AS t;  -- text wins.
    >  t
    > ---
    >  f
    > (1 row)
    >
    >
    > contrib/citext/expected/citext.out:
    > SELECT 'a'::citext >= 'B'::text AS t;  -- text wins.
    >  t
    > ---
    >  t
    > (1 row)
    >
    > same input, return different result,  The comment "-- text wins."
    > seems confusing.
    > (this happens in other places within citext.out, citext_1.out).
    >
    
    
    Well, that's because there is single sql test file, so no variation here is
    possible. We can simply delete comment, or we can rephrase it to reflect,
    under which conditions text wins
    
    >
    
  3. Re: citext_1.out, citext.out confusing comment

    Julien Rouhaud <rjuju123@gmail.com> — 2025-12-09T09:55:16Z

    On Tue, Dec 09, 2025 at 12:30:51PM +0500, Kirill Reshke wrote:
    > On Tue, 9 Dec 2025, 10:08 jian he, <jian.universality@gmail.com> wrote:
    >
    > > hi.
    > >
    > > While working on CAST DEFAULT, I found out citext_1.out, citext.out
    > > comments are
    > > confusing.
    > >
    > > contrib/citext/expected/citext_1.out:
    > > SELECT 'a'::citext >= 'B'::text AS t;  -- text wins.
    > >  t
    > > ---
    > >  f
    > > (1 row)
    > >
    > >
    > > contrib/citext/expected/citext.out:
    > > SELECT 'a'::citext >= 'B'::text AS t;  -- text wins.
    > >  t
    > > ---
    > >  t
    > > (1 row)
    > >
    > > same input, return different result,  The comment "-- text wins."
    > > seems confusing.
    > > (this happens in other places within citext.out, citext_1.out).
    > >
    >
    > Well, that's because there is single sql test file, so no variation here is
    > possible. We can simply delete comment, or we can rephrase it to reflect,
    > under which conditions text wins
    
    text always wins, which is why the alternative exists: the result depends on
    the default collation sort order under which that test is run.