From: | Gary Chambers <gwc(at)gwcmail(dot)com> |
---|---|
To: | PostgreSQL SQL Mailing List <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Query Advice |
Date: | 2017-03-30 19:19:54 |
Message-ID: | alpine.DEB.2.20.1703301505350.17355@websrv.gogca.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Gentlemen,
Thank you for your replies.
I'm working on a Python Flask web application.
> To comment as to "better" without any knowledge of the "application layer"
> doesn't make sense. I suggest you provide an example of what you'd like
> the output to look like independent of any query concerns.
"Better" is to have the results returned without having the address columns
delimited by some character. The simple join that Jason suggested is
definitely sufficient, but it seems like returning the repeating name column
is unnecessary.
My question is really more theoretical than anything else. Vincent's
suggestion to return JSON is probably the closest to what I am trying to
accomplish. My ultimate goal is to have the equivalent of a Python list of
dictionaries as addresses, though the keys aren't a requirement as long as I
can define the order of the columns and avoid using the delimiter.
That being said, how would I accomplish this and return the data in the
usual SQL results format without using concat_ws()?
Thank you, again, for your advice.
--
G.
From | Date | Subject | |
---|---|---|---|
Next Message | Gary Chambers | 2017-03-30 19:22:12 | Re: Query Advice |
Previous Message | Jason Aleski | 2017-03-30 18:27:27 | Re: Query Advice |