Skip to content

Instantly share code, notes, and snippets.

@lkraman
Created April 3, 2019 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lkraman/fdf06d16c6e4ce0bdcf629e40874b2ab to your computer and use it in GitHub Desktop.
Save lkraman/fdf06d16c6e4ce0bdcf629e40874b2ab to your computer and use it in GitHub Desktop.
Installing and Using Relational Databases
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+----------------------------+----------------------------+-----------------------
inventory | postgres | UTF8 | English_United States.1252 | English_United States.1252 |
library | postgres | UTF8 | English_United States.1252 | English_United States.1252 |
postgres | postgres | UTF8 | English_United States.1252 | English_United States.1252 |
template0 | postgres | UTF8 | English_United States.1252 | English_United States.1252 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | English_United States.1252 | English_United States.1252 | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)
postgres=# \c library
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
You are now connected to database "library" as user "postgres".
library=# SELECT * FROM books;
id | title | author
------+------------------------------------------+---------------------
1259 | Eloquent Ruby | Russell A. Olson
1593 | JavaScript: The Good Parts | Douglas Crockford
8982 | Designing Object-Oriented Software | Rebecca Wirfs-Brock
7265 | Practical Object-Oriented Design in Ruby | Sandi Metz
(4 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment