Jeff Ross <jross@xxxxxxxxxx> 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