Created
August 15, 2017 11:24
-
-
Save carlosspohr/80176f858c277be332ae8d0c8968460a to your computer and use it in GitHub Desktop.
Instance of how to use uuids on Postgres.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
select uuid_generate_v4(); | |
SELECT uuid_in(md5(random()::text || now()::text)::cstring); | |
create table teste ( | |
id uuid not null primary key | |
); | |
insert into teste (id)values(uuid_generate_v4()) | |
; | |
select * from teste; | |
select | |
uuid_generate_v4() as bla; | |
union all | |
uuid_generate_v4() as bla; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment