[racket] in-query problems

From: George Neuner (gneuner2 at comcast.net)
Date: Wed Dec 10 16:22:22 EST 2014

Forgot to mention 2 other oddities.

1)  If there is more than one column, in-query requires parentheses 
around the column list.  None of the other row returning functions do.  
But putting parentheses around * doesn't work ... it doesn't produce an 
error but it returns nothing.


2)  if you do parenthesize a column list  in query, query-rows, etc.  
then  Postgresql  arrays and  timestamp types become unreadable.

(query-rows dbc "select (username,last_login) from users")
=>  (#(#("gneuner2" unreadable)))

(query-rows dbc "select username,last_login from users")
=> (#("gneuner2" #(struct:sql-timestamp 2014 11 21 8 13 59 70923000 0)))

I don't know about in general, but in Postgresql  "select  a,b ..." is 
very different from "select (a,b) ...".  The former produces a row 
result and the latter produces a Postgresql record type which I believe 
Racket can't handle.

Is that what you meant before by  "row" vs "record".   I interpreted it 
then as database parlance (where it didn't parse) and not as something 
Postgresql specific.


George


Posted on the users mailing list.