I am using pgAdmin-4 and created a database with a single table, but select returns an error message: 'table oid'
I'm using a normal select query.
SELECT * FROM escola
This happens with PostgreSQL 11.4.
If you want to select data from all the columns of the table, you can use an asterisk ( * ) shorthand instead of specifying all the column names. The select list may also contain expressions or literal values. Second, specify the name of the table from which you want to query data after the FROM keyword.
After the PostgreSQL server receives a query from the client application, the text of the query is handed to the parser. The parser scans through the query and checks it for syntax errors. If the query is syntactically correct, the parser will transform the query text into a parse tree.
<> is the standard SQL operator meaning "not equal". Many databases, including postgresql, supports != as a synonym for <> . They're exactly the same in postgresql.
Use ILIKE : SELECT * FROM table WHERE columnName ILIKE 'R%'; or a case-insensitive regular expression: SELECT * FROM table WHERE columnName ~* '^R.
The problem is due to python3-psycopg2. The latest pgadmin4 version requires psycopg2-2.8. But if you're on Debian/Ubuntu stable, apt installed v2.7. So you need to update it with pip :
sudo pip3 install -U psycopg2
Then update the pgadmin4 config to add the local python path:
nano ~/.config/pgadmin/pgadmin4.conf
# or with a right click on the system tray icon
# add /usr/local/lib/python3.6/dist-packages to the PythonPath.
Same thing with python3.7 (just change the lib path)
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With