postgresql-simple
postgresql-simple copied to clipboard
Mid-level client library for accessing PostgreSQL from Haskell
Every once in a while I am noting "another command is already in progress" errors from libpq. The respective application manages database connections in a resource pool. I am now...
Transactions that enter an error state must be aborted manually by issuing a "ROLLBACK". However, if the transaction error happened during a "COMMIT" then the rollback happens automatically. Issuing a...
The following query works: ``` select uuid_generate_v3(t.x, 'foo') from (values ('55c163fc-8e21-4f2a-b26d-6a7fa3e5d896'::uuid)) as t(x); ``` but this does not: ``` select uuid_generate_v3(t.x, 'foo') from (values ('55c163fc-8e21-4f2a-b26d-6a7fa3e5d896')) as t(x); ``` The `ToField`...
I'm opening this issue to track support for composite types. Here's what I have so far. ```haskell -- Adapted code from: https://hackage.haskell.org/package/postgresql-simple-0.4.10.0/docs/src/Database-PostgreSQL-Simple-Arrays.html module Composite where import Prelude import Database.PostgreSQL.Simple.FromField import...
Hello! How can I make `(a, b) == (1, 2)` in ```hs [Only (a, b)] select (1,2); row ------- (1,2) (1 row) ``` Thank you!
I got a dump of live data in an HSTORE column from our production DB using: \copy (select properties from clients where array_length(akeys(properties), 1)>0) to '/tmp/client_properties.txt'; One of the rows...
This builds upon #259 by adding an `LSN` type for querying PostgreSQL's WAL replication status.
This would be useful to do `fmap join . sequenceA . listToMaybe` on a query which normally returns `[Only (Maybe a)]`. With the magic sequence this becomes `Only (Maybe a)`.
Currently, in [ToField](http://hackage.haskell.org/packages/archive/postgresql-simple/latest/doc/html/Database-PostgreSQL-Simple-ToField.html), the [ByteString instance](http://hackage.haskell.org/packages/archive/postgresql-simple/0.2.4.0/doc/html/src/Database-PostgreSQL-Simple-ToField.html#line-167) treats the argument as text format. For example: ``` > let bs = "\\123" :: ByteString > bs "\\123" > query conn "SELECT ?...