Mid-level client library for accessing PostgreSQL from Haskell
Questions tagged [postgresql-simple]
22 questions
1
vote
1 answer
haskell postgresql-simple incompatible type _int8 and Int64 (and Integer)
The erroneous function below is part of a program called subdivide working with Postgis geospatial intersections on the server side and processing the returned array of Int64 on the client side.
It is built and run under Stack, resolving to Nightly…

Mike Thomas
- 13
- 2
0
votes
0 answers
Error when trying to query with snaplet-postgres-simple
I'm quite new to Haskell and Snap framework. I'm trying to implement a REST API server but I have some problems querying the Postgresql database using snaplet-postgresql-simple.
queryDatabase::(B.ByteString,B.ByteString)…

23ars
- 647
- 3
- 16
- 37
0
votes
0 answers
How to create a Heterogenous map of SqlField's without reimplementing every possible SqlField in Haskell
I want to use the postgresql-simple library to construct a Map or HashMap of SqlValues. I know one approach to do this would be to redefine all of the SqlValue's into a single universal type ala
data SqlValue = SqlInt Int
| SqlString…

emg184
- 850
- 8
- 19
0
votes
1 answer
SqlError due to single quotes around parameterized value for `CREATE DATABASE`
I'm using the "postgresql-simple" library and running into a SqlError with the following:
_ <- execute con "CREATE DATABASE ?" (Only ("example" :: String))
Results in an error of:
SqlError {sqlState = "42601", sqlExecStatus = FatalError,…

Chris Stryczynski
- 30,145
- 48
- 175
- 286
0
votes
0 answers
user error (Pattern match failure in do expression) with PostgreSQL.Simple
My schema:
CREATE TABLE IF NOT EXISTS feed (
id SERIAL PRIMARY KEY CHECK (id > 0),
name TEXT NOT NULL,
url TEXT NOT NULL
);
My code:
{-# LANGUAGE OverloadedStrings #-}
import Database.PostgreSQL.Simple
hello :: IO String
hello =…

Thomas Koch
- 2,833
- 2
- 28
- 36
0
votes
3 answers
PostgreSQL-simple `execute` on a function fails with "execute resulted in Col 1-column result"
I want to execute a Postgres function from Haskell which updates 3 rows but is declared with RETURNS VOID. I run the function as follows:
catch (do execute conn "select record(?,?)" [id1, id2])
(\(e :: SomeException) -> do putStrLn…

Alex
- 8,093
- 6
- 49
- 79
0
votes
1 answer
postgresql-simple query error
EDIT: I now have a better idea of what is going wrong. When I perform that query in plain old psql, I get the following result:
lwm@verbos
=# SELECT * FROM gerund LIMIT1;
infinitive │ gerund │ gerund_english
…
user2913694