superset icon indicating copy to clipboard operation
superset copied to clipboard

postgresql database connect ok but tables not shown

Open sunnysnowhi opened this issue 6 years ago • 6 comments

I install the superset in my CentOS server, and login from web successfully. And then I add the database and check connection, the check result is "seems ok!" image

but at the bottom , the table list is empty! image

when I click 'Tables' and search , there is still no result image

my database is postgresql, and I tried both the url "postgresql://" and "postgresql+psycopg2:// ", the connect is all ok and tables are all not shown.

I am sure I have some tables in my database, what's wrong?

Thank you!

sunnysnowhi avatar Apr 17 '20 07:04 sunnysnowhi

and no error log on the server screen image

superset version: Python 3.6.3 Flask 1.1.2 Werkzeug 1.0.1

I use these command to install postgresql in superset virtual env yum install postgresql-devel* pip install psycopg2

and the version is : psycopg2-2.8.5

Should I install some other packages?

sunnysnowhi avatar Apr 17 '20 07:04 sunnysnowhi

@sunnysnowhi , In tables you see the tables that YOU add. It does not automatically load there. SQL Lab -> SQL Editor is the only place that the tables get automatically filled so you can do queries to explore the data, as in this : image

But in tables are just the tables that you upload to do charts.

eugeniamz avatar Apr 20 '20 18:04 eugeniamz

@eugeniamz thank you very much, table must add manually! Click the + button in Tables image

And choose the database , then write the table name here and save image

Then the table will display here~~ image

sunnysnowhi avatar Apr 29 '20 08:04 sunnysnowhi

@eugeniamz I am trying to add Postgres database table.Even though I have table in my database while adding it manually into superset tables I am getting table not found error. Error: Table [public.trail] could not be found, please double check your database connection, schema, and table name

Please find the attached screenshots

TableReferenceInPGAdmin TableError

stardev24 avatar May 13 '20 08:05 stardev24

Superset uses SQLAlchemy Schema. It returns connection OK on postgres even without defining dbname at the end. In order to show tables on that db, we need to specify dbname after port number:

postgresql://<username>:<password>@<host>:<port>/<db_name>

PetengDedet avatar Dec 25 '20 07:12 PetengDedet

@eugeniamz thank you very much, table must add manually! Click the + button in Tables image

And choose the database , then write the table name here and save image

Then the table will display here~~ image

Please check the Postgresql schema settings. Try filling in public in the Schema input box.

zhaoyongjie avatar Dec 25 '20 10:12 zhaoyongjie