You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATEDATABASEfk_vis_reprex;
CREATEUSERfk_vis_owner WITH PASSWORD 'pwd123';
CREATEUSERfk_vis_reader WITH PASSWORD 'pwd345';
GRANT CONNECT, TEMPORARY, CREATE ON DATABASE fk_vis_reprex TO fk_vis_owner;
GRANT CONNECT, TEMPORARY ON DATABASE fk_vis_reprex TO fk_vis_reader;
then, with a connection of our user fk_vis_owner, some more set up (as psql -d fk_vis_reprex -U fk_vis_owner ):
CREATESCHEMAfk_vis;
GRANT USAGE ON SCHEMA fk_vis TO fk_vis_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA fk_vis GRANTSELECTON TABLES TO fk_vis_reader;
CREATETABLEfk_vis.item (
item INT GENERATED ALWAYS AS IDENTITY,
name VARCHAR(255) NOT NULL,
PRIMARY KEY(item)
);
CREATETABLEfk_vis.customer (
customer INT GENERATED ALWAYS AS IDENTITY,
name VARCHAR(255) NOT NULL,
PRIMARY KEY(customer)
);
CREATETABLEfk_vis.sale (
sale INT GENERATED ALWAYS AS IDENTITY,
item INT,
customer INT,
PRIMARY KEY(sale),
CONSTRAINT fk_item
FOREIGN KEY(item)
REFERENCESfk_vis.item(item),
CONSTRAINT fk_customer
FOREIGN KEY(customer)
REFERENCESfk_vis.customer(customer)
);
Running atlas schema inspect using our two users gives different results
General set up:
then, with a connection of our user
fk_vis_owner
, some more set up (aspsql -d fk_vis_reprex -U fk_vis_owner
):Running
atlas schema inspect
using our two users gives different resultsfk_vis_owner
fk_vis_reader
with foreign keys missing for the second invocation (using the "reader" user, i.e. not the owner of the tables).
From what I understand, there is no restriction for getting this information as the "reader" user (as
psql -d fk_vis_reprex -U fk_vis_reader
):The text was updated successfully, but these errors were encountered: