Created
June 6, 2022 16:36
-
-
Save ValentinMouret/7aaa35509ab58cce6e4510b468d42ece to your computer and use it in GitHub Desktop.
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 table users ( | |
name text primary key, | |
age int not null, | |
is_adult boolean generated always as (age >= 18) stored | |
); | |
insert into users | |
(name, age) | |
values ('Zola', 54), | |
('Rimbaud', 8); | |
select is_adult | |
from users | |
where name = 'Zola'; | |
-- is_adult | |
-- -------- | |
-- true | |
-- false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment