Permalink
Switch branches/tags
Nothing to show
Commits on Nov 28, 2013
  1. Point people to the new version

    Kevin Burke committed Nov 28, 2013
Commits on Jan 5, 2013
  1. Support timestamp without tz, redux

    This time, some more effort has been paid to testing on an older Go
    version, 1.0.2, and carefully preserving the old hacks to make time
    parsing work with those older versions with a less useful time.Parse.
    It has also been tested on Go 1.0.3.
    
    This just lets the Go time package use its default behavior when one
    is left without time offset information.  Hope it is a behavior people
    want.
    
    The main change here is pushing down the column type into the parsing
    function, as Go's time parsing can't deal with data that only has the
    fractional-hour timezone offset when such a fraction exists
    (e.g. "-07" for "-07:00", but "-7:30" necessarily retaining its
    precision).  This old hack could not be applied unconditionally (it is
    wrong when the timestamp has no time zone offset suffix), so this
    information lets a correct decision be made.
    
    Clearly, this approach also can't handle the Postgres datestyle
    parameter, but that's a fight to pick some other time.
    
    As a target of opportunity, move the 'oid' type to 'types.go', since
    for now all oids I know of handled by the program are type oids.  This
    causes 'go fmt' to go a little nuts and rewrite the long but boring
    file.
    
    Signed-off-by: Daniel Farina <daniel@fdr.io>
    fdr committed Jan 5, 2013
  2. Revert "Support timestamp without tz"

    Seems to work on some older or younger go devel, but not on a release
    version, it seems.
    
    This reverts commit 7f1933f.
    fdr committed Jan 5, 2013
  3. Support timestamp without tz

    This just lets Go's time package do what it is going to by default
    when one is left without offset information.  Hope it's a behavior
    people want.
    
    The main change here is pushing down the column type into the parsing
    function, as Go's time parsing can't deal with data that only has the
    fractional-hour timezone offset when such a fraction exists
    (e.g. "-07" for "-07:00", but "-7:30" necessarily retaining its
    precision).  This old hack could not be applied unconditionally (it is
    wrong when the timestamp has no time zone offset suffix), so this
    information lets a correct decision be made.
    
    Clearly, this approach also can't handle the Postgres datestyle
    parameter, but that's a fight to pick some other time.
    
    Signed-off-by: Daniel Farina <daniel@fdr.io>
    fdr committed Jan 5, 2013
  4. Credit Kamil Kisiel

    Signed-off-by: Daniel Farina <daniel@heroku.com>
    Daniel Farina committed Jan 5, 2013
  5. Add parameter type sensitivity to type encoding

    This requires recording the response to parsing to know what types are
    expected for parameters, and then passing that information to the type
    encoder.
    
    Signed-off-by: Daniel Farina <daniel@heroku.com>
    Daniel Farina committed Jan 5, 2013
  6. Confirm that Postgres does not allow bad cstrings for param values

    Looks like it is checked in postgres.c:exec_bind_message if the format
    of parameters is textual...which seems like all of them right now.
    
    It also looks like for binary mode that Postgres may protect against
    this, by ensuring that a type receive function eats the entire
    parameter value buffer.  A poorly written Postgres recv (binary
    decoding) function could open the user to nul byte injections, but I'm
    not sure if there's much to be done about that.
    
    Signed-off-by: Daniel Farina <daniel@heroku.com>
    Daniel Farina committed Jan 5, 2013
  7. Credit Martin Olsen

    Signed-off-by: Daniel Farina <daniel@heroku.com>
    Daniel Farina committed Jan 5, 2013
Commits on Jan 4, 2013
  1. Add clear-text authentication.

    martinolsen committed with Daniel Farina Oct 27, 2012
  2. Add overdue credits for those assisting in recent maintenance

    Signed-off-by: Daniel Farina <daniel@heroku.com>
    Daniel Farina committed Jan 4, 2013
Commits on Dec 27, 2012
  1. Add failing test for error checking on 64 bits int

    Currently some error checking in buf.go is done by converting an uint32 to
    int. For 32 bit int this works correctly, however when int is 64 bits,
    0xffffffff != -1 and this error checking fails, leading to a slice out of
    bounds panic.
    
    Some editorialization has been done to use a VALUES literal as opposed
    to temp table/inserts in the test.
    
    Signed-off-by: Daniel Farina <daniel@fdr.io>
    aeons committed with fdr Oct 3, 2012
  2. Add more expansive timezone test.

    Also includes a fix for the "30 minute offset" timezones referenced in
    issue #51.
    jgallagher committed with fdr Nov 7, 2012
  3. Ignore ParameterStatus responses to simpleQuery.

    This allows running, e.g., "SET TIME ZONE 'US/Eastern'".
    jgallagher committed with fdr Nov 7, 2012
Commits on Oct 8, 2012
  1. fix #46 - ignore all notices

    committed Oct 8, 2012
  2. Add result parsing benchmark

    To see what's slow, try this:
    
            go test -c
    
            # Run for 5s
            go test -test.bench='BenchmarkResultParsing' \
               -test.cpuprofile=cpu.prof -test.benchtime 5
    
            pprof pq.test cpu.prof
    
    In the pprof (sometimes called google-pprof) prompt:
    
            (pprof) web
    
    Signed-off-by: Dan Farina <drfarina@acm.org>
    Dan Farina committed with Jul 26, 2012
  3. may be too harsh

    committed Oct 8, 2012
Commits on Sep 20, 2012
  1. Add recover function that will report the PG reason.

    Update Open() to use this so connection errors can be seen.
    tmc committed Sep 20, 2012
Commits on Sep 10, 2012
  1. LICENCE - fixes #40

    committed Sep 10, 2012
Commits on Aug 9, 2012
  1. Revert "Use bufio.Reader"

    This reverts commit a6c22b1.
    committed Aug 9, 2012
Commits on Aug 7, 2012
Commits on Aug 4, 2012
  1. Discard notice messages.

    When running a simple query like 'DROP TABLE IF EXISTS foo;', Postgres
    will send a warning if "foo" does not exist. This patch makes it ignore
    the warning.
    
    It is not well tested, also I am unsure whether or not more data needs
    to be consumed. However, instead of putting into this specific issue,
    the following needs to be considered (from
    <http://www.postgresql.org/docs/9.1/static/protocol-flow.html#PROTOCOL-ASYNC?):
    
      Note: At present, NotificationResponse can only be sent outside a
      transaction, and thus it will not occur in the middle of a
      command-response series, though it might occur just before
      ReadyForQuery. It is unwise to design frontend logic that assumes
      that, however. Good practice is to be able to accept
      NotificationResponse at any point in the protocol.
    mbr committed Aug 4, 2012
Commits on Jul 29, 2012
  1. Use bufio.Reader

    jgallagher committed Jul 29, 2012
Commits on Jul 10, 2012
Commits on Jun 20, 2012
  1. link to docs

    kr committed Jun 20, 2012
Commits on Jun 13, 2012
  1. clean up return

    committed Jun 13, 2012
  2. fix whitespace error

    committed Jun 13, 2012
Commits on Apr 17, 2012