Skip to content
This repository has been archived by the owner on May 23, 2020. It is now read-only.
/ pgkata Public archive

PG Kata is an exercise designed as introduction to PostgreSQL

Notifications You must be signed in to change notification settings

gurdulu/pgkata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PG Kata

PG Kata is an exercise designed as introduction to PostgreSQL.

Pre-requisites

  1. PostgreSQL

    For the documentation on how to install it see PostgreSQL: Downloads.

  2. Any editor, preferably with syntax highlighting.

    If you don't have one, install Atom.

  3. Optional pgAdmin.

How to proceed

I assume you are using a *nix platform.

Create a directory and open you editor.

Open a terminal and create the database pgkata.

# createdb pgkata

Read the scenario and print out the diagram.

Start following the steps.

Useful commands

psql is a very powerful tool. You can have a look at the options with the command psql --help.

Some useful options are

-c, --command=COMMAND    run only single command (SQL or internal) and exit
-f, --file=FILENAME      execute commands from file, then exit
-b, --echo-errors        echo failed commands
-a, --echo-all           echo all input from script
-b, --echo-errors        echo failed commands
-e, --echo-queries       echo commands sent to server
-E, --echo-hidden        display queries that internal commands generate
-L, --log-file=FILENAME  send session log to file

Connect to the database pgkata (command: psql pgkata) and type \? for seeing the psql internal commands.

Some useful commands are

\d[S+]                 list tables, views, and sequences
\d[S+]  NAME           describe table, view, sequence, or index
\timing [on|off]       toggle timing of commands (currently off)
\h [NAME]              help on syntax of SQL commands, * for all commands

About

PG Kata is an exercise designed as introduction to PostgreSQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages