Skip to content

Instantly share code, notes, and snippets.

@maksadbek
Created August 12, 2020 11:56
Show Gist options
  • Save maksadbek/6c86330b160faea2ab9c60e71faa52c2 to your computer and use it in GitHub Desktop.
Save maksadbek/6c86330b160faea2ab9c60e71faa52c2 to your computer and use it in GitHub Desktop.
create table model(
id serial primary key,
name text,
tags text[]
);
insert into model(name, tags) values ('a', array['a', 'b', 'c']);
insert into model(name, tags) values ('b', array['b', 'b', 'c']);
select unnest(tags) as tag, count(*) from model group by tag;
select * from model where id = 1;
select pg_current_wal_lsn();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment