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

Cannot find tables in PostgreSQL database with db_prefix #7093

Closed
Vskilet opened this issue Nov 29, 2019 · 2 comments
Closed

Cannot find tables in PostgreSQL database with db_prefix #7093

Vskilet opened this issue Nov 29, 2019 · 2 comments

Comments

@Vskilet
Copy link

Vskilet commented Nov 29, 2019

Hi,
I try to upgrade a roundcube instance from 1.3.10 to 1.4.1. During update, I've this error message :

Updating` database schema (2013011000)... [FAILED]
ERROR: Error in DDL upgrade 2013011000: [7] ERROR:  relation "rcsystem" already exists

In my config I use the prefix 'rc' and my db_dsnw is correct (I checked all the cases that speak about this problem in this repo)
I use postgreSQL 9.6.15

I found this version strange because :

SELECT value FROM rcsystem WHERE name = 'roundcube-version';
   value    
------------
 2019092900

Have you an idea of what I misunderstood ?

@alecpl
Copy link
Member

alecpl commented Dec 13, 2019

Confirmed. It looks that when using postgres database with db_prefix, the prefix is used as a table schema. So, we end up with following query.

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = 'rc' ORDER BY TABLE_NAME;

We should treat the prefix as a schema name only if it ends with a dot.

@alecpl alecpl added this to the 1.4.2 milestone Dec 13, 2019
@alecpl alecpl changed the title Error in DDL upgrade 2013011000 Cannot find tables in PostgreSQL database with db_prefix Dec 13, 2019
@alecpl
Copy link
Member

alecpl commented Dec 13, 2019

Fixed.

@alecpl alecpl closed this as completed Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants