pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steven Lembark <lembark@wrkhors.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Selecting strict, immutable text for a composite type.
Date: Thu, 10 May 2018 11:52:48 -0400
Message-ID: <20099.1525967568@sss.pgh.pa.us> (raw)
In-Reply-To: <20180510103041.472408bb@wrkhors.com>
References: <20180510103041.472408bb@wrkhors.com>

Steven Lembark <lembark@wrkhors.com> writes:
> Q: What is the syntax for a strict, immutable function in 
>    SQL that returns text suitable for use with either 
>    creating a "select *" view or a GIST index?

Your example works just fine for me ...

regression=# select lat_lng_text('(42,54.5)');
 lat_lng_text 
--------------
 42-54.5
(1 row)

Maybe you should show a more concrete example of what's not working.

Side comment: I think you need to rethink that text representation,
because it'll be at best ugly with a negative longitude.  Is there a
reason not to just use the default record representation (with parens
and a comma)?

			regards, tom lane




view thread (8+ messages)  latest in thread

Message-ID: <20099.1525967568@sss.pgh.pa.us>
Permalink:  ../20099.1525967568@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20099.1525967568@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lembark@wrkhors.com
  Subject: Re: Selecting strict, immutable text for a composite type.
  In-Reply-To: <20099.1525967568@sss.pgh.pa.us>
  References: <20180510103041.472408bb@wrkhors.com> <20099.1525967568@sss.pgh.pa.us>

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

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