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 the ‘\ 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 close the text editor. We can edit that in the query in a text editor and can run it again. The ‘\e’ command opens the recently executed SQL query in a text editor. Command to use the psql with the text editor The ‘\g’ command is used to execute the previous command.ġ7. The ‘\timing’ command is used to get the execution time of the SQL query in the PostgreSQL.ġ6. Command to get the execution time of SQL query Illustrate the result of the command by using the following snapshot.ġ5. If we want detailed information about any statement, we can use this command. The ‘\ h’ command lists all SQL commands in the PostgreSQL. We can save the history in the file by using the ‘\s filename’ command.The ‘\ s’ command is used to view the complete history in the PostgreSQL.The ‘\ du’ command lists all the users with their roles. The ‘\ dv’ command is used to list available views in the current database.ġ1. The ‘\ df’ command is used to list all of the functions of the current database. The ‘\ dn’ command is used to list all of the schemas of the current database. The ‘\d table_name’ command is 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 the current database The ‘\c db_name ’ command is 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.Ĥ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |