Untrusted functions on index creation. - Mailing list pgsql-general

From Geoff Russell
Subject Untrusted functions on index creation.
Date
Msg-id Pine.GSO.4.05.9911012142420.21882-100000@teal
Whole thread Raw
Responses Re: [GENERAL] Untrusted functions on index creation.
List pgsql-general
Hi,

I want a case independent index on people's names and am having troubles.

Here is some output from a postgres run:

/*
 * First lets drop the tables and index
 */
drop index upper_name ;
drop function myupper (text);
drop table prosb;
drop sequence prosb_brief_seq;
/*
 * now make them
 */
create table prosb (
    animal_s    text,
    brief serial primary key,
    defendant_name text ,
    payment_received text
    ... ETC
);
NOTICE:  CREATE TABLE will create implicit sequence prosb_brief_seq for SERIAL column prosb.brief
NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index prosb_pkey for table prosb
CREATE
create function
    myupper (text)
    returns text
        AS 'SELECT upper($1);' LANGUAGE 'sql';
CREATE
/*
 * the index creation works fine
 */
create index upper_name on prosb (myupper(defendant_name) varchar_ops);
CREATE

insert into prosb (animal_s, defendant_name) values('cat','John');
ERROR:  internal error: untrusted function not supported.
insert into prosb (animal_s, defendant_name) values('cat','Steven');
ERROR:  internal error: untrusted function not supported.
insert into prosb (animal_s, defendant_name) values('dog','Mike');
ERROR:  internal error: untrusted function not supported.

I tried using plpgsql instead of sql, but PG tells me the language isn't
registered.

Cheers,
Geoff,

geoff@austrics.com.au            | Phone: +618-8332-5069
6 Fifth Ave, St Morris, SA 5068  |   Fax: +618-8364-1543


pgsql-general by date:

Previous
From: "nicks.emails"
Date:
Subject: pgsql backend disconnected
Next
From: Stuart Rison
Date:
Subject: Re: [GENERAL] Untrusted functions on index creation.