Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jerem
Copy link

@jerem jerem commented Mar 4, 2025

Issue
Database switching fails because the current URL path is replaced with the database name, causing the leading / to be missing. This results in incorrect URL resolution.

Fix
Ensure the replacement retains the leading / when updating the URL path with the new database name.

@sosedoff
Copy link
Owner

@jerem do you have specific instructions on how to reproduce the issue?

@sosedoff
Copy link
Owner

@jerem ping on this -- if this is really an issue i'd like to have some way of reproducing the bug. information like wether you're running pgweb in containers, k8s with some specific configuration would also help

@Benno007
Copy link

Benno007 commented May 13, 2025

Unsure if related to this particular issue, we were having issues with bookmark swapping

We are running pgweb in kubernetes. We have two pods running, and use multiple bookmarks to connect to different connection strings.

We recently added 10 bookmarks (a single bookmark worked ok), and are now unable to connect properly.

What we do:
Load the pgweb UI, may still be logged into another DB
Click Disconnect
Click a new bookmark
Click Connect
Upon login, the new connections schema and tables are there, but the old bookmarks schemas are there. If I click around the tables, in some cases I get "ERROR: pq: relation "public.some_table" does not exist"

Swapping back to just one pod fixed the issue and we can swap bookmarks. I assume it's an issue with shared state between the two pods for the current connection maybe just not supported? Would we need a shared volume if the current connection is stored to disk?

@sosedoff
Copy link
Owner

@Benno007 yea pgweb is not meant to be executed in a multi-pod environment unless all post are connected to the same database, so bookmarks are kinda off the table. Main issue is pgweb's state -- nothing is stored in cookies or db store of any kind, so if you're load-balancing connections for different databases, you'd need to find an alternative option.

@jerem
Copy link
Author

jerem commented Jun 17, 2025

@jerem ping on this -- if this is really an issue i'd like to have some way of reproducing the bug. information like wether you're running pgweb in containers, k8s with some specific configuration would also help

@sosedoff Thanks for looking into this.

I can consistently reproduce the bug with the following setup:

PostgreSQL: v16.9, running locally, listening on the default Unix socket.
pgweb: v0.16.2, executed locally with the command: pgweb --skip-open --url 'postgres:///postgres?host=/var/run/postgresql'

Steps to reproduce:

Launch pgweb as described above.
In the pgweb interface, attempt to select a database other than postgres.
Observed error: {"error":"Database name is not provided","status":400}

Screencast.From.2025-06-17.14-38-24.mp4

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

Successfully merging this pull request may close these issues.

3 participants