Oracle commands Vs PostgreSQL commands
Oracle commands Vs PostgreSQL commands
Feature/command | Oracle Commands | PostgreSQL Commands |
Switch connection to a new database | SQL>alter session set container=pdb1; | postgres=# \c test1 |
List available databases | SQL> show pdbs | postgres=# \l |
List available tables | SQL>select * from tab; | postgres=# \ dt |
Execute the previous command | SQL> / | postgres=# \g |
Turn on\off query execution time | SQL> set timing on/off | postgres=# \timing on/off |
Edit statements in editor | SQL>ed | postgres=# \e |
Connection Information | SQL> show user | postgres=# \conninfo |
Spooling | SQL> spool output.log (output.log is a file)
SQL>spool off |
postgres#\o output.log
output.log is a filename |
To run OS commands (ex: on windows) | SQL>!cls | postgres#\!cls |
See also