The ‘\h’ command used to list all SQL commands in the PostgreSQL. We can save the history in the file by using the ‘\s filename’ command.The ‘\s’ command used to view the complete history in the PostgreSQL.The ‘\du’ command used to list all the users with their roles. The ‘\dv’ command used to list available views in the current database.ġ1. The ‘\df’ command used to list all of the functions of the current database. The ‘\dn’ command used to list all of the schemas of the current database. The ‘\d table_name’ command used to describe the table. Illustrate the result of the ‘\dt’ command by using the following snapshot. The ‘\dt’ command returns the tables from the current database. Command for listing all of the tables from current database The ‘\c db_name ’ command used to switch the connection to the new database.Ħ. Command to switch database connection to the new database ![]() Illustrate the result of the above command by using the following snapshot.ĥ. This command is used to connect to the database. Illustrate the result of the ‘\l’ command by using the following snapshot.Ĥ. The ‘\l’ command returns all of the databases available in PostgreSQL. Command to list all of the available databases Illustrate the result of the ‘SELECT’ command by using the following snapshot.ģ. The ‘SELECT VERSION()’ statement returns the version of PostgreSQL. Command to get the version of the PostgreSQL Illustrate the result of the ‘\?’ command by using the following snapshot.Ģ. ![]() The ‘\?’ command returns all of the commands available in PostgreSQL. Command to list all commands available in PostgreSQL ![]() Given below are the various meta-commands: 1. The PostgreSQL supports various commands which we can execute from the psql prompt.įirst, we will open the psql prompt which looks like the following snapshot. Hadoop, Data Science, Statistics & others List of PostgreSQL Commands with Examples
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |