-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide support for PostgreSQL arrays #13
Labels
Comments
Then I must use something dirty like this:
If you implement it in the module, then maybe proper arrays can be received instead. |
Supporting arrays is not a very low-hanging fruit: Currently, the pq
module is ignorant about any non-basic type and just yields a text
representation of them. Since they can be nested and contain other
composite types, doing it properly requires investigating the involved
types further in the system catalog. I guess this can double the amount
of code currently in the pq module.
I didn't suffer from the lack of support for composite types in the pq
module yet, since I avoid composite types in the public parts of my
schema designs. After all, they violate 1NF and thus cause other
trouble as well.
Maybe you can work around your problem with postgres' UNNEST operator?
For example, you could let postgres unpack the arrays in a more robust
way than your function sql-array-to-list:
```
(mapcar
(lambda (pgarr)
(pq:query *pq* "select * from UNNEST ($1::text[]);" pgarr))
(pq:query *pq* "select c from a"))
(("d" "e" "f") ("a" "b" "c"))
```
regards,
Andreas
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Table:
Result:
In my opinion that is poor for Emacs Lisp to receive just textual representation of PostgreSQL arrays. I was expecting to receive some better structure.
Is it feasible to support PostgreSQL arrays so that Emacs Lisp receives better structure out of it?
The text was updated successfully, but these errors were encountered: