Re: [INTERFACES] Re: [HACKERS] changes in 6.4 - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: [INTERFACES] Re: [HACKERS] changes in 6.4
Date
Msg-id 35ADDC68.F13FACB0@trust.ee
Whole thread Raw
In response to Re: [HACKERS] atttypmod now 32 bits, interface change]  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [INTERFACES] Re: [HACKERS] changes in 6.4
List pgsql-hackers
Vadim Mikheev wrote:
>
> Hannu Krosing wrote:
> >
> > but functions still dont work:
> >
> > hannu=> create table test1 (a text, b text,
> > hannu-> check (trim(a) <> '' or trim(b) <> ''));
> > ERROR:  parser: parse error at or near "trim"
>
> TRIM is keyword, not a function...
> We have to copy some lines in gram.y

Wow! is this standard ?

I found the function trim by doing 'select oprname from pg_oper'
and tested it as follows:

hannu=> select trim('      x       ');
btrim
-----
x
(1 row)

why is the column called btrim ?
some rewrite magic in parser ?

If it must stay a keyword, then perhaps we should remove the proc ?

> Real functions are working...

yep! Thanks:

create table test2(a text,b text, check (btrim(a) <> '' or btrim(b) <>
''));

does work ;)

Hannu

pgsql-hackers by date:

Previous
From: Aleksey Dashevsky
Date:
Subject: Re: [INTERFACES] Re: [HACKERS] changes in 6.4
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [INTERFACES] Re: [HACKERS] changes in 6.4