
BEGIN;

DELETE FROM pg_catalog.pg_proc WHERE proname = 'nextval';

CREATE FUNCTION nextval(text)
RETURNS bigint
AS 'lastval.so','nextval_new'
LANGUAGE 'C';

COMMENT ON FUNCTION nextval(text) IS 'sequence next value';

CREATE FUNCTION lastval()
RETURNS bigint
AS 'lastval.so','lastval'
LANGUAGE 'C';

COMMENT ON FUNCTION lastval() IS 'sequence last value';

COMMIT;
