pg_dump handling of trim() - Mailing list pgsql-bugs

From Troels Arvin
Subject pg_dump handling of trim()
Date
Msg-id pan.2003.07.16.21.36.18.406573@arvin.dk
Whole thread Raw
List pgsql-bugs
Hello,

In a table, I have:

create table foo(
  ...,
  id_alpha3 character(3) NOT NULL
    CHECK (character_length(trim(both ' ' from id_alpha3)) = 3),
  ...
);

When I do a pg_dump, pg_dump translates it to:

CREATE TABLE foo (
    ...
    id_alpha3 character(3) NOT NULL,
    ...
    CONSTRAINT country_id_alpha3 CHECK ((character_length(btrim((id_alpha3)::text, ' '::text)) = 3)),
);

I.e., use of SQL:1999 standard "TRIM(BOTH somechar FROM ...)" is changed
into use of PostgreSQL-specific BTRIM().

As PostgreSQL seems to strive to be standard compliant, I consider the
above a (minor) bug.

--
Greetings from Troels Arvin, Copenhagen, Denmark

pgsql-bugs by date:

Previous
From: cookfire@softhome.net
Date:
Subject: PL/PGSQL stat failed on file '$libdir/plpgsql'
Next
From: "Thomas Behr"
Date:
Subject: Small problem in contrib/dbase/dbf2pg.c