"Jean-Yves F. Barbier" <12ukwn(at)gmail(dot)com> writes:
> I've made a small function but it is refused:
> CREATE FUNCTION get_user_oid(TEXT) -- 1- Owner's name
> RETURNS OID AS $$
> SELECT usesysid AS useroid FROM pg_user WHERE usename = $1;
> END;
> $$ LANGUAGE sql;
You don't want the END; there (that's plpgsql syntax not SQL).
regards, tom lane