Skip to content

Instantly share code, notes, and snippets.

@felipenoris
Last active October 2, 2018 17:07
Show Gist options
  • Save felipenoris/6e3453f181da48d2d16e3bf6347579ce to your computer and use it in GitHub Desktop.
Save felipenoris/6e3453f181da48d2d16e3bf6347579ce to your computer and use it in GitHub Desktop.

Install Postgresql as a normal user (no root)

Download generic Linux binaries

Server Configuration

Initialize data directory.

$ mkdir postgresql
$ initdb -D ./postgresql/

Start the server

$ pg_ctl -D ./postgresql/ -l postgresql.log start

Create database named example:

$ createdb example

REPL:

$ psql example

Quit REPL:

example=# \q

Connecting from Julia

using LibPQ, DataStreams, NamedTuples
conn = LibPQ.Connection("dbname=example")
result = execute(conn, "SELECT * FROM TB_TEST")
data = Data.stream!(result, NamedTuple)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment