```sql CREATE OR REPLACE FUNCTION "public"."uuid_generate_v4"() RETURNS "pg_catalog"."uuid" AS '$libdir/uuid-ossp', 'uuid_generate_v4' LANGUAGE c VOLATILE STRICT COST 1; ``` openGauss写法 ```sql CREATE OR REPLACE FUNCTION "public"."uuid_generate_v4"() returns varchar LANGUAGE plpgsql NOT FENCED NOT SHIPPABLE AS $function$ DECLARE BEGIN RETURN (select upper(md5(random()::text || clock_timestamp()::text) :: varchar)); END$function$; ```