ВК
Size: a a a
ВК
ВК
N
ВК
N
EZ
N
EZ
a
drop table if exists test;
create table test (id serial primary key , value text unique );
with inserted as (
insert into test (value)
select ser::text from generate_series(0, 10) as ser
on conflict (value) do update
set value=excluded.value
returning *
)
select * from test
inner join inserted using (id) for update;
A
ALTER SCHEMA public OWNER TO user_db;
REVOKE ALL ON SCHEMA public FROM public;
ALTER SCHEMA public OWNER TO postgres;
REVOKE ALL ON SCHEMA public FROM public;
GRANT CONNECT ON DATABASE stage_test TO andrey;
\c stage_test
GRANT USAGE ON SCHEMA public TO andrey;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO andrey;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO andrey;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON SEQUENCES TO andrey;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO andrey;
\dn+
после этого такойpublic | postgres | postgres=UC/postgres | standard public schema
N
SG
ВК
NB
R
R
NB
VY
ALTER SCHEMA public OWNER TO postgres;
REVOKE ALL ON SCHEMA public FROM public;
GRANT CONNECT ON DATABASE stage_test TO andrey;
\c stage_test
GRANT USAGE ON SCHEMA public TO andrey;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO andrey;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO andrey;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON SEQUENCES TO andrey;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO andrey;
\dn+
после этого такойpublic | postgres | postgres=UC/postgres | standard public schema
andrey
не superuser случаем? \du andrey
что говорит?NB