pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Empty String Comparison Standard compliant?
Date: Fri, 30 Jan 2004 07:29:21 -0800 (PST)
Message-ID: <20040130072502.O55110@megazone.bigpanda.com> (raw)
In-Reply-To: <200401301212.NAA11553@rodos>
References: <200401301212.NAA11553@rodos>


On Fri, 30 Jan 2004, Christoph Haller wrote:

> Just a short question (PostgreSQL 7.3.4 on hppa-hp-hpux10.20, compiled by GCC 2.8.1)
>
> SELECT ('' > 'GDMF') ; SELECT ('GDMF' > '');
>  ?column?
> ----------
>  f
> (1 row)
>
>  ?column?
> ----------
>  t
> (1 row)
>
> Are these results standard compliant?

I think so in general.  If the two lengths are not equal, then
"effectively" the shorter string is replaced by an extended version.  If
it's NO PAD (varchar/text for us) the character used is a character that
sorts less than any string.  Otherwise (char) it's a space.  Then you use
the collating sequence to determine the value of >.  Most will put space
before any of GDMF, so the above seems reasonable.





view thread (3+ messages)

Message-ID: <20040130072502.O55110@megazone.bigpanda.com>
Permalink:  ../20040130072502.O55110@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040130072502.O55110@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, ch@rodos.fzk.de
  Subject: Re: Empty String Comparison Standard compliant?
  In-Reply-To: <20040130072502.O55110@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox