pgx/examples/chat
Jack Christensen 119ba7a449 Fix go vet issues 2018-01-13 10:08:02 -06:00
..
README.md Update examples to use PG envvars 2017-09-01 14:25:03 -05:00
main.go Fix go vet issues 2018-01-13 10:08:02 -06:00

README.md

Description

This is a sample chat program implemented using PostgreSQL's listen/notify functionality with pgx.

Start multiple instances of this program connected to the same database to chat between them.

Connection configuration

The database connection is configured via the standard PostgreSQL environment variables.

  • PGHOST - defaults to localhost
  • PGUSER - defaults to current OS user
  • PGPASSWORD - defaults to empty string
  • PGDATABASE - defaults to user name

You can either export them then run chat:

export PGHOST=/private/tmp
./chat

Or you can prefix the chat execution with the environment variables:

PGHOST=/private/tmp ./chat