Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SET Session as READONLY on connect #189

Open
jay-babu opened this issue Oct 17, 2024 · 3 comments
Open

SET Session as READONLY on connect #189

jay-babu opened this issue Oct 17, 2024 · 3 comments

Comments

@jay-babu
Copy link

Hello,

I am using postgres as my connection. What is the recommendation on setting a session as readonly by default? This is a safeguard that I want by default. I want to opt out of readonly when I want to modify data. Is there an autocmd I can use to run something after connect? https://stackoverflow.com/questions/41960217/connecting-to-postgres-database-with-read-only-access - a few options are listed here on how to set as readonly. I believe the psqlrc is ignored when connecting. Thanks!

@tpope
Copy link
Owner

tpope commented Oct 18, 2024

I believe the psqlrc is ignored when connecting.

First things first, what does this mean? When is it ignored, and when isn't it?

@jay-babu
Copy link
Author

https://github.com/tpope/vim-dadbod/blob/master/autoload/db/adapter/postgresql.vim

maybe I am looking at this file wrong. I see this flag, --no-psqlrc, passed in. Maybe line 13 is run when running a sql command

@tpope
Copy link
Owner

tpope commented Oct 20, 2024

Yeah, --no-psqlrc is only for tab completing database and table names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants