diff options
author | Bruce Momjian <bruce@momjian.us> | 2014-02-24 12:09:23 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2014-02-24 12:09:23 -0500 |
commit | 8457d0beca731bf062bb0d126870d9a291ab47a5 (patch) | |
tree | e703a20567f4577283e698617e03f060e406092a /src/backend/utils/adt/varchar.c | |
parent | 6615e77439a3c8c26c0091a616f00eefdea22604 (diff) | |
download | postgresql-8457d0beca731bf062bb0d126870d9a291ab47a5.tar.gz postgresql-8457d0beca731bf062bb0d126870d9a291ab47a5.zip |
docs: document behavior of CHAR() comparisons with chars < space
Space trimming rather than space-padding causes unusual behavior, which
might not be standards-compliant.
Also remove recently-added now-redundant C comment.
Diffstat (limited to 'src/backend/utils/adt/varchar.c')
-rw-r--r-- | src/backend/utils/adt/varchar.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 284b5d13093..502ca44e04a 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -846,18 +846,6 @@ bpcharcmp(PG_FUNCTION_ARGS) len2; int cmp; - /* - * Trimming trailing spaces off of both strings can cause a string - * with a character less than a space to compare greater than a - * space-extended string, e.g. this returns false: - * SELECT E'ab\n'::CHAR(10) < E'ab '::CHAR(10); - * even though '\n' is less than the space if CHAR(10) was - * space-extended. The correct solution would be to trim only - * the longer string to be the same length of the shorter, if - * possible, then do the comparison. However, changing this - * might break existing indexes, breaking binary upgrades. - * For details, see http://www.postgresql.org/message-id/CAK+WP1xdmyswEehMuetNztM4H199Z1w9KWRHVMKzyyFM+hV=zA@mail.gmail.com - */ len1 = bcTruelen(arg1); len2 = bcTruelen(arg2); |