pg_dump handling of trim()

From: Troels Arvin <troels(at)arvin(dot)dk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg_dump handling of trim()
Date: 2003-07-16 21:36:20
Message-ID: pan.2003.07.16.21.36.18.406573@arvin.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2003-07-17 13:25:33 Re: pg_dump -t option doesn't take schema-qualified table
Previous Message Tom Lane 2003-07-16 20:26:15 Re: Vacuum going -D; crash or just impatience?