go-pgsql

module
v0.0.0-...-7a41c3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2012 License: BSD-3-Clause

README

About go-pgsql
==============

go-pgsql is a [PostgreSQL](http://www.postgresql.org) client library for the
[Go](http://golang.org) programming language.

It partially implements version 3.0 of the
[PostgreSQL](http://www.postgresql.org) frontend/backend protocol, so it
should work with servers of version 7.4 and later.

Installing go-pgsql
===================

1. Make sure you have a working [Go](http://golang.org) installation, see
   the installation guide at http://golang.org/doc/install.html
2. git clone http://github.com/lxn/go-pgsql.git
3. cd go-pgsql/src/pkg/pgsql && gomake install

Alternatively you can use goinstall:
goinstall github.com/lxn/go-pgsql/src/pkg/pgsql

Using go-pgsql
==============

There are some examples in the
[src/cmd/examples](go-pgsql/tree/master/src/cmd/examples) directory which
should get you started.

Please open an issue on the bug tracker if you encounter a bug.

Missing Features
================

go-pgsql is currently missing support for some features, including:

- authentication types other than MD5
- SSL encrypted sessions
- some data types like bytea, ...
- canceling commands/queries
- bulk copy
- ...

go-pgsql is (at least for now) not thread-safe, so for every goroutine
that must talk to the same database, a separate Conn is required.

Connection Info
================

To connect, you must pass a connection string to pgsql.Connect().
Much as with the libpq conninfo parameter, values are optional, and
may be overridden by environment variables at runtime, specifically:

- PGPORT - port number
- PGUSER - user name (defaults to postgres)
- PGHOST - host name/address (defaults to localhost)
- PGDATABASE - name of database (defaults to user name if not specified)


Time/Timestamp resolution
=========================

Because the resolution of time.Time is seconds, fractions of seconds are
silently dropped by `*ResultSet.Time` and `*ResultSet.TimeSeconds`.

Directories

Path Synopsis
src
pkg/pgsql
The pgsql package implements a PostgreSQL frontend library.
The pgsql package implements a PostgreSQL frontend library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL