Skip to content

Commit a1ab88c

Browse files
authored
Update postgres_tips.md
1 parent 017c59b commit a1ab88c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

postgres/postgres_tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Enter: The typed uuid. It looks like a usual UUID, but it has a prefix added to
2020
The following code will add typed_uuid functionality to your postgres database:
2121
```sql
2222
CREATE DOMAIN typed_uuid AS
23-
VARCHAR CHECK ((VALUE IS NULL) OR (split_part(value,'_', 2)::uuid IS NOT NULL));
23+
VARCHAR CHECK ((VALUE IS NULL) OR (split_part(value,'|', 2)::uuid IS NOT NULL));
2424

2525
CREATE OR REPLACE FUNCTION public.generate_typed_uuid(type_name text)
2626
RETURNS text
@@ -31,7 +31,7 @@ AS $function$
3131
IF type_name IS NULL THEN
3232
RAISE EXCEPTION 'generate_typed_uuid must have a type_name passed to it.';
3333
ELSE
34-
RETURN type_name || '_' || uuid_generate_v4();
34+
RETURN type_name || '|' || uuid_generate_v4();
3535
END IF;
3636
END;
3737
$function$

0 commit comments

Comments
 (0)