Re: invalid regular expression: invalid backreference number - Mailing list pgsql-general

From Tom Lane
Subject Re: invalid regular expression: invalid backreference number
Date
Msg-id 2255.1171852805@sss.pgh.pa.us
Whole thread Raw
In response to Re: invalid regular expression: invalid backreference number  (Jeff Ross <jross@wykids.org>)
List pgsql-general
Jeff Ross <jross@wykids.org> writes:
> To debug this I've extracted the code into its own function:

> CREATE FUNCTION gen_password() RETURNS text AS $$
> DECLARE
>   password text;
>   chars := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
> BEGIN

You forgot to give a type for the "chars" variable.

> psql:create_password.sql:12: ERROR:  invalid type name ""
> CONTEXT:  compile of PL/pgSQL function "gen_password" near line 3

I agree that this is a pretty awful error message :-( ... will take a
look at whether it can be improved.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: invalid regular expression: invalid backreference number
Next
From: "CAJ CAJ"
Date:
Subject: Write errors in postgres log