Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX.. - Mailing list pgsql-general

From Lamar Owen
Subject Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..
Date
Msg-id 399220C8.62EAC20A@wgcr.org
Whole thread Raw
In response to Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..  (Philip Hallstrom <philip@adhesivemedia.com>)
Responses Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..  (Philip Hallstrom <philip@adhesivemedia.com>)
List pgsql-general
Philip Hallstrom wrote:
> CREATE INDEX test_idx ON test (UPPER(field));

> devloki=> create index foo on rolo_entry (UPPER(fname));
> ERROR:  DefineIndex: function 'upper(varchar)' does not exist
> devloki=> create index foo on rolo_entry (UPPER(varchar(fname)));
> ERROR:  parser: parse error at or near "varchar"
> devloki=> create index foo on rolo_entry (UPPER(text(fname)));
> ERROR:  parser: parse error at or near "("
> devloki=> create index foo on rolo_entry (UPPER(text fname));
> ERROR:  parser: parse error at or near "fname"
> devloki=> create index foo on rolo_entry (UPPER(fname::text));
> ERROR:  parser: parse error at or near "::"
> devloki=> create index foo on rolo_entry (UPPER(CAST(fname AS TEXT)));
> ERROR:  parser: parse error at or near "cast"

> So, by creating a function such as UPPER(varchar) instead of the built-in
> UPPER(text), I can do what I want.

> What's odd, is that I can create the function UPPER(varchar) which then
> calls UPPER(text) and use it all I want.  However, if I then try to create
> an index (like my first example above) it locks up the entire machine.

That is wild.  I'd say bring this up in the hackers list -- as upper
should also work with varchar by default.

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

pgsql-general by date:

Previous
From: Philip Hallstrom
Date:
Subject: Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..
Next
From: Philip Hallstrom
Date:
Subject: Re: Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..