1. Cheat Sheet Recipes
  2. Postgres Shell Commands
  3. Postgresql Psql Commands

PostgreSQL Cheat Sheet Some things to note about SQL: All SQL statements end in a semicolon. You can separate statements into separate lines, for readability, as long as you declare the end with a semicolon. Postgresql Basic Commands Login to postgresql. Psql -U postgres psql -d mydb -U myuser -W psql -h myhost -d mydb -U myuser -W psql -U myuser -h myhost 'dbname=mydb. PostgreSQL Cheat Sheet PostgreSQL. Created on: 2019-01-22. Psql Meta-Commands. The following are the Meta-Commands for psql command.

Starting the server

Windows Users

You must do this every time you restart your machine.

Mac Users

After you have run this command the first time, postgres will start automatically whenever you boot up your computer.

Starting the postgres shell

Open the shell and connect to the city_explorer database:

psql city_explorer

With no arguments, psql will start the shell connected to your user-default database.

Creating a database

This will create a new database called “book_wiki”, which can contain many individual tables:

CREATE DATABASE book_wiki;

Quit the postgres shell

Type the backslash character, immediatly followed by a “q”:

yourname=# q

Basic shell navigation

List all of your databases

yourname=# l

Connect to a database

yourname=# c book_wiki

Printable

List all tables (aka: relations) in the database

yourname=# dt

The command dt means “describe table”.

Display the schema for a table

yourname=# d table-name

Troubleshooting Tips

Error - psql not connected to server

psql: could not connect to server: No such file or directory

Solution - Turn Postgres On

See above notes about starting the server.

Error - schema.sql file not found

When connecting your schema.sql to your database:

Cheat Sheet Recipes

schema.sql: No such file or directory

Collaborate for free with an online version of Microsoft PowerPoint. Save presentations in OneDrive. Share them with others and work together at the same time. Free powerpoint for windows 10. Use Spoken Language to see the voice languages that PowerPoint can recognize and select the one you want. This is the language that you will be speaking while presenting. Use Subtitle Language to see which languages PowerPoint can display on-screen as captions or subtitles and select the one you want. This is the language of the text that will. Browse to the folder where you want to save your presentation. In the File name box, type a name for your presentation. Under Save as type, select PowerPoint Show. The file is saved as a.ppsx file. Choose the PPT file that you want to convert. Select PPTX as the the format you want to convert your PPT file to. Click 'Convert' to convert your PPT file. Zamzar Pro Tip: If you have a Mac you can open PPT files in Keynote as well as Microsoft Powerpoint. Choose the PPS file that you want to convert. Select PPT as the the format you want to convert your PPS file to. Click 'Convert' to convert your PPS file. Zamzar Pro Tip: If you have a Mac you can open PPS files in Keynote as well as Microsoft Powerpoint on Windows.

Postgres Shell Commands

Solution

Postgresql Psql Commands

You must specify the full path to the .sql file or run the command from the same directory where the .sql file lives.