![]() ![]() Also, we saw several examples of the PostgreSQL commands. In this article we saw how to use the PostgreSQL commands and how the PostgreSQL commands works. Illustrate the result of the above command by using the following snapshot. The ‘\q’ command is used to quit the psql in the PostgreSQL. In order to illustrate the effect of ‘\H’ command for the output format change, we will execute the ‘select * from employee’ command and will have a look at the output.Ģ0. The command ‘\H’ is used to format the output in the HTML format. Command to switch output format to HTML format ![]() In order to illustrate the effect of ‘\a’ command for the output format change, we will execute the select * from employee’ command and will have a look at the output.ġ9. Now we will again switch the output format by using ‘\a’ command. In order to illustrate the effect of ‘\a’ command for the output format change, we will execute the ‘select * from employee’ command and will have a look at the output. We will switch the output format by using ‘\a’ command. The command ‘\a’ is used to switch the output format from aligned to the non-aligned column and vice-versa. Command to switch output format from aligned to the non-aligned column and vice-versa Illustrate the result of the step by using the following snapshot.ġ8. Now we will modify the SQL query in a text editor and then we will close the text editor. We can edit that in the query in a text editor and can run it again. The ‘\e’ command used to open the recently executed SQL query in a text editor. Command to use the psql with the text editor The ‘\g’ command used to execute the previous command.ġ7. The ‘\timing’ command used to get the execution time of the SQL query in the PostgreSQL.ġ6. Command to get the execution time of SQL query This is an extension of the SQL standard. (Since PostgreSQL treats built-in types like user-defined types, built-in types appear here as well. Illustrate the result of the command by using the following snapshot.ġ5. The columns udtname, udtschema, and udtcatalog always identify the underlying data type of the column, even if the column is based on a domain. If we want to have detailed information about any statement then we can use this command. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |