agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Gary Chambers <gwchamb@gwcmail.com>
To: PostgreSQL SQL Mailing List <pgsql-sql@postgresql.org>
Subject: Re: Query Advice
Date: Thu, 30 Mar 2017 15:22:12 -0400 (EDT)
Message-ID: <alpine.DEB.2.20.1703301521280.17355@websrv.gogca.com> (raw)
In-Reply-To: <CAKFQuwbto5hNVhPqKL3acJMbdTHLHb3-5T1UbBsBf0YTcOGY5w@mail.gmail.com>
References: <alpine.DEB.2.20.1703301350250.17355@websrv.gogca.com>
	<CAKFQuwbto5hNVhPqKL3acJMbdTHLHb3-5T1UbBsBf0YTcOGY5w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (7+ messages)

Message-ID: <alpine.DEB.2.20.1703301521280.17355@websrv.gogca.com>
Permalink:  ../alpine.DEB.2.20.1703301521280.17355@websrv.gogca.com/
Also on:    postgresql.org/message-id/alpine.DEB.2.20.1703301521280.17355@websrv.gogca.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gwchamb@gwcmail.com
  Subject: Re: Query Advice
  In-Reply-To: <alpine.DEB.2.20.1703301521280.17355@websrv.gogca.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox