Re: invalid regular expression: invalid backreference number

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Ross <jross(at)wykids(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: invalid regular expression: invalid backreference number
Date: 2007-02-19 02:40:05
Message-ID: 2255.1171852805@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Ross <jross(at)wykids(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message CAJ CAJ 2007-02-19 05:20:35 Write errors in postgres log
Previous Message Stephan Szabo 2007-02-19 02:39:12 Re: invalid regular expression: invalid backreference number