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
Describe the bug
A run_migrations task in webapp was stuck indefinitely. I understood this was in relatiiopn with eacb390
We sawt an attempt at altering "user" table in Iris DB. While troubleshooting we saw a potential issue.
The table exists and has valid data inside. However the name "user" is also a reserved keyword for PostgreSQL.
This query returns the current db active user:
iris_db_prod=> select * from user;
user
db_admin_user
(1 row)
db_admin_user is the user we use to connect to the DB (via POSTGRES_USER and POSTGRES_ADMIN_USER).
When quoting user, then we get the content of iris_db_prod > user table
Expected behavior
"user" keyword as table name should not be used. A quick Google search returns plenty of these conclusions.
Additional context
user is a reserved keyword in PosgreSQL 16 documentation, therefore it is best practice to not use it, especially as table name, otgherwise this leads to unexpected behavior like above.
The text was updated successfully, but these errors were encountered:
Describe the bug
A run_migrations task in webapp was stuck indefinitely. I understood this was in relatiiopn with eacb390
We sawt an attempt at altering "user" table in Iris DB. While troubleshooting we saw a potential issue.
The table exists and has valid data inside. However the name "user" is also a reserved keyword for PostgreSQL.
This query returns the current db active user:
iris_db_prod=> select * from user;
user
db_admin_user
(1 row)
db_admin_user is the user we use to connect to the DB (via POSTGRES_USER and POSTGRES_ADMIN_USER).
When quoting user, then we get the content of iris_db_prod > user table
iris_db_prod=> select * from "user";
id | user | name | email | uuid | ...
----+-----------------------------------+----------------------+-----------------------------------+--------------------------------------+- ...
1 | [email protected] | User1 | [email protected] | xxx | ...
2 | [email protected] | User2 | [email protected] | xxx | ...
(2 rows)
Also with specifying public schema:
iris_db_prod=> select * from public.user;
id | user | name | email | uuid | ...
----+-----------------------------------+----------------------+-----------------------------------+--------------------------------------+- ...
1 | [email protected] | User1 | [email protected] | xxx | ...
2 | [email protected] | User2 | [email protected] | xxx | ...
(2 rows)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
"user" keyword as table name should not be used. A quick Google search returns plenty of these conclusions.
Additional context
user is a reserved keyword in PosgreSQL 16 documentation, therefore it is best practice to not use it, especially as table name, otgherwise this leads to unexpected behavior like above.
The text was updated successfully, but these errors were encountered: