For some reason I am unable to view my database tables for my Wiki & I can't understand what I am doing wrong or what I'm missing. I know for sure there's table data on my 'wiki' database but for some reason I don't know how to list it.
Type "help" for help.
No relations found.
No relations found.
Am I doing something wrong as I know there's data in there. I believe I'm just not submitting the proper commands to the server. Thanks for any assistance.
The schema is named "mediawiki" and the database is named "wiki"
I understand the database name is 'wiki' & the table name is 'mediawiki' but on MySQL it's very clear and easy to understand:
mysql> use wiki
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> show tables;
| Tables_in_wiki |
| dp_archive |
| dp_category |
| dp_categorylinks |
| dp_change_tag |
| dp_externallinks |
| dp_filearchive |
As you can see I connect to the database called 'wiki' & then run 'SHOW TABLES' SQL command and I can see the tables clearly. This is not the case when I type '\dt' in PostgreSQL. Why do I get the "No relations available" error when I try to view the tables for the 'wiki' database? So what if they're called 'mediawiki'? Why doesn't it list them when I enter the proper command?
I understand the database name is 'wiki' & the table name is 'mediawiki'
The schema name is wiki, not not the table name.
but on MySQL it's very clear and easy to understand
Well PostgreSQL is not MySQL.
Why do I get the "No relations available" error when I try to view the tables for the 'wiki' database? So what if they're called 'mediawiki'? Why doesn't it list them when I enter the proper command?
Because your application chose to create the tables in the schema mediawiki during installation (it actively created that schema, and then created the tables in that schema). If it had not specified a schema, things would work just as you expect.
To find out why the application created the tables that way, you need to ask the manufacturer of your application.
What you can do, to make life easier is to make the mediawiki schema your default schema by changing the user you use to connect to the database:
ALTER USER your_user_name_goes_here SET search_path= 'mediawiki,public';
(I think you need to log out and log in to make that change have an effect).
Don't try to do things the "MySQL way" you won't get far if you assume PostgreSQL works the same as MySQL (or DB2 or Oracle or SQL Server or Informix).
You have to accept the fact that each DBMS is different and changing from MySQL to PostgreSQL is a big step because MySQL fails to comply with so many standards (wrong literal quoting, wrong object quoting, wrong concatenation operator, ....)