create role r1 with login ;
grant usage on schema new_tests to r1;
grant SELECT ON ALL TABLES IN SCHEMA new_tests TO r1;
now, as r1 user login, copy to, see the difference between csv and parquet cases:
set search_path to new_tests ;
copy num to '/tmp/num.csv';
ERROR: permission denied to COPY to a file
DETAIL: Only roles with privileges of the "pg_write_server_files" role may COPY to a file.
HINT: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone.
postgres=> copy num to '/tmp/num.parquet';
COPY 9
copy from, see the difference between csv and parquet cases:
copy num from '/tmp/num.csv';
ERROR: permission denied to COPY from a file
DETAIL: Only roles with privileges of the "pg_read_server_files" role may COPY from a file.
HINT: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone.
postgres=> copy num from '/tmp/num.parquet';
COPY 9
As a superuser:
now, as
r1
user login,copy to
, see the difference betweencsv
andparquet
cases:copy from, see the difference between
csv
andparquet
cases: