Skip to content

Alembic detects existing changes if db username equals postgres schema name #1447

Discussion options

You must be logged in to vote

hi -

log into your database with the working URL, then type this:

test=> select current_schema();
 current_schema 
----------------
 public
(1 row)

then log in to the database with a username that matches an existing schema name, try again, for me my username is "scott", so ill create a schema with that name (note that im not even disconnecting in my case):

test=> create schema scott;
CREATE SCHEMA
test=> select current_schema();
 current_schema 
----------------
 scott
(1 row)

it changed! this is because of a variable known as the search_path which defaults to this:

test=> show search_path;
   search_path   
-----------------
 "$user", public
(1 row)

the "public" name is the one we…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexvas96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
Converted from issue

This discussion was converted from issue #1445 on March 19, 2024 11:55.