There is a web project on asp.net. The task is to connect not to the PUBLIC scheme, but to any OTHER scheme. How to do it? Where to write the name of the desired scheme? There is a webconfig in the ASP.NET project, there comes a connection string with the server name, password and id. 
- Does the user specified in the connection string have access to read from this scheme? Try to connect to the server on behalf of this user in PG Admin and query the desired scheme. If there is no access, add it. GRANT SELECT - if necessary, add (, INSERT, UPDATE, DELETE) ON ALL TABLES IN SCHEMA public TO user_name; - Liashenko V
- GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA audit TO user_name; - Liashenko V
- Grants prescribed. The connection itself is not clear how to do. - Dmitry Nikitin
|
1 answer
Let's do this, you can only connect to the database. Schemes are entities within the database and you either have access to them or not. Which scheme is currently determined by the search_path parameter is set at the time of the session, and not at the time of connection. Look in the documentation for your webconfig, where you can set defaultSchema, if this opportunity is laid by the developer.
Or make the first request set search_path=your_schema
Yes, and check with requests such as select * from your_schema.your_table; - that you have access to the table of this scheme, at least for select
- set search_path = your_schema - can I use a link to an example / resource here, please? - Dmitry Nikitin
|