Re: Selecting strict, immutable text for a composite type.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steven Lembark <lembark(at)wrkhors(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Selecting strict, immutable text for a composite type.
Date: 2018-05-10 15:52:48
Message-ID: 20099.1525967568@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steven Lembark <lembark(at)wrkhors(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben Hood 2018-05-10 16:09:08 Re: Domain based on TIMEZONE WITH TIME ZONE
Previous Message Francisco Olarte 2018-05-10 15:50:42 Re: Enhancement to psql command, feedback.