On Thu, Apr 23, 2015 at 5:22 PM, Cobus Carstens
<
cobus.c...@gmail.com> wrote:
>
> Personally I am not a fan of converting the column name to an atom, mostly because it can be something like 'avg((foo + bar) / baz)'.
pgapp:equery("select avg(foo) + 1 from bar", []).
{ok,[{column,<<"?column?">>,float8,8,-1,1}],[{1.0}]}
pgapp:equery("select avg(foo) + 1 as avg from bar", []).
{ok,[{column,<<"avg">>,float8,8,-1,1}],[{1.0}]}
You get the "?column?" string if it can't decide on a name. Which
does not make for a very good atom, but... you can easily use 'as' if
you want a nice name.