Forum Discussion
PostgreSQL Data Source with number in table name not recognized
Hi everyone,
I would like to build a Power BI report with a data source that has numbers as their name e.g. 25hourshotel
We have a database host selector and a database selector, so that we will only havbve to write the host and database in these fields and it will be automatically inserted in all queries, so thats what you see in the first screenshot.
In the second screenshot i tried to fill in the database name but the same error occurs.
Any ideas on how I can fix that?
Thanks for your help!
Hi Anonymous
PostgreSQL table names should not start with a number.
If you have to work with tables that do, you can wrap the table name in double quotes
PostgreSQL SQL Syntax and Use | PostgreSQL Naming Rules | InformIT
Try this for your SELECT
"SELECT * from ""25hourshotel.25hourshotel.overview"""Regards
Phil
2 Replies
- PhilipTreacySuper User
Hi Anonymous
PostgreSQL table names should not start with a number.
If you have to work with tables that do, you can wrap the table name in double quotes
PostgreSQL SQL Syntax and Use | PostgreSQL Naming Rules | InformIT
Try this for your SELECT
"SELECT * from ""25hourshotel.25hourshotel.overview"""Regards
Phil
- AnonymousNot applicable
Hi Phil,
unfortunately I didn't create the data source and had to work with the number in the name. Anyway, I tried the double and triple quotes and they solved my problem, thanks!