Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which postgresql package should I use?

Tags:

I'd like to access an existing postgres database, which is on my local (mac) machine, from haskell.

I can see quite a few postgres packages on hackage. Which is likely to be the easiest for me to use?

like image 772
Peter Hall Avatar asked Jan 03 '12 00:01

Peter Hall


People also ask

Which version of PostgreSQL should I use?

SaltStack Config requires a PostgreSQL 9.6 database, but PostgreSQL 12.4 is recommended. The recommended version of PostgreSQL is included with the SaltStack Config installer. PostgreSQL is a third-party open source database that is required for SaltStack Config.

Are there packages in PostgreSQL?

In PostgreSQL, use type varchar or text instead. Similarly, replace type number with numeric , or use some other numeric data type if there's a more appropriate one. Instead of packages, use schemas to organize your functions into groups. Since there are no packages, there are no package-level variables either.

What is the best free GUI PostgreSQL client for Windows?

pgAdmin. pgAdmin is the de facto GUI tool for PostgreSQL, and the first tool anyone would use for PostgreSQL. It supports all PostgreSQL operations and features while being free and open source. pgAdmin is used by both novice and seasoned DBAs and developers for database administration.


2 Answers

postgresql-simple, a binding to libpq, was just announced, and seems to have a nice feature set. I haven't used it myself (or indeed PostgreSQL from Haskell at all), but it seems to have community support, so I'd recommend it if you don't want to use a particular library on top (like HDBC or persistent).

The alternatives appear to be libpq (another binding to libpq), which postgre-simple is based on, and pgsql-simple (a direct implementation of the wire protocol in Haskell), which, going by the post, doesn't seem ready for prime-time yet, and is not on Hackage.

There is also a PostgreSQL driver for HDBC; the PostgreSQL backend for the persistent library (as used in Yesod) is based on it.

like image 165
ehird Avatar answered Oct 17 '22 15:10

ehird


Opaleye is a higher-level alternative to postgresql-simple. It uses postgresql-simple under the hood but provides a typesafe and composable API.

http://hackage.haskell.org/package/opaleye

like image 26
Tom Ellis Avatar answered Oct 17 '22 15:10

Tom Ellis