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
Using Postgres 12, I can create a user and set the search path of that user:
create user "${username}" with encrypted password '${password}';
create schema "${schema}" authorization "${username}";
alteruser"${username}"set search_path ="${schema},public";
grant usage on schema public to "${username}";
grantselecton all tables in schema public to "${username}";
Using a pgClient, I can see that the search path is set correctly:
SHOW search_path;
// returns "<schema>,public"
Running SELECT queries I see that the custom schema IS in the search path. However, when trying to create a table the search path can't be found:
CREATETABLEtest (
id integerPRIMARY KEY,
name varchar(40)
);
// returns "no schema has been selected to create in"
If I adjust the SQL to specify the search path first, then it works as expected:
SET search_path = "${schema},public";
CREATE TABLE test (
id integer PRIMARY KEY,
name varchar(40)
);
If I use Postgres via DBeaver with the same client credentials (and just login with the user, without updating the search path), then this works as expected.
Using Postgres 12, I can create a user and set the search path of that user:
Using a
pg
Client
, I can see that the search path is set correctly:Running
SELECT
queries I see that the custom schema IS in the search path. However, when trying to create a table the search path can't be found:If I adjust the SQL to specify the search path first, then it works as expected:
If I use Postgres via DBeaver with the same client credentials (and just login with the user, without updating the search path), then this works as expected.
I am creating a client like this:
The text was updated successfully, but these errors were encountered: