'Why command \dt gives - no relations found?
I have created a database in postgres. It has 3 empty tables. The table has user tom as its Superuser along with root. I am logged in as tom and connected to mydb database. But still the commands \d or \dt - gives no relations found.
Is there any alternate to SHOW TABLE in postgresql?
Could not find solution here
I get results from - \dt *.*.
Solution 1:[1]
I solved my problem by using double quote e.g \d "Table_name". Because my table name is capitalized like Foo, Bar. Hope that could help someones.
Solution 2:[2]
You might not be connected to the right database.
The first command \c DATABASE_NAME, coming from the following comment on Reddit, did the trick for me.
Make sure you're connected to the correct database with \c . Using \l will list all databases regardless of which database you're connected to, but most commands are specific to the connected database.
Use \dt .* to list all tables with name matching in all schemas.
Assuming the table exists, it will tell you what schema it's in. Then you can query with SELECT * FROM .;.
If you want to avoid having to explicitly specify the schema name, make sure the schema that contains the table is in your path: SHOW search_path and SET search_path .
Solution 3:[3]
If you have different instances of postgres running on server on different port it helps when you connect to database with specific port psql -p 5432 databasename( or psql -p 5433 databasename etc.)
Solution 4:[4]
you must have not added a semicolon at the end that's what always happens to me I always forget my semicolon -> create table nameoftable()
Solution 5:[5]
This happened for me when I removed the default privileges for PUBLIC on the public schema (specifically the USAGE privilege).
Solution 6:[6]
I had the exact same issue. None of the answers above helped. I was able to see my table when I ran \dt .*. Then I realized I had to call explicitly state its schema when running SELECT statements.
So, if you run SELECT * FROM public.<your_tablename_goes_here>; it should work. I hope this helps!
Solution 7:[7]
It is possible to do this. I can't write you any code, but you have to implement a pre-commit hook, and in it call svnlook to get information about the current commit.
Main information is the author of the commit, and for this you call svnlook author (see the not-accepted answer).
Another important information is what the user is changing. For this you call svnlook change, and parse the result.
To see the comment you use svnlook log.
All three calls to svnlook require the path to the repo (local path on the svn server) and the transaction ID. You get both of those as command line parameters of the pre-commit hook script
Sorting users into groups is done in the script. You can hard-code all the users there, or have a separate configuration file, as a mini-database, that the script would read. One line per user, and in the line there would be data indicating what that user can and cannot do.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | VuLe |
| Solution 2 | |
| Solution 3 | Bahtiyar |
| Solution 4 | Triangle |
| Solution 5 | Mike Conigliaro |
| Solution 6 | Hazar Panc |
| Solution 7 |
