Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGnsD-0001o9-OV for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 15:52:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGnsC-0001Wb-D2 for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 15:52:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGnsC-0001WR-1i for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 15:52:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGns9-0002rB-L3 for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 15:52:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w4AFqmOr020100; Thu, 10 May 2018 11:52:48 -0400 From: Tom Lane To: Steven Lembark cc: pgsql-general@lists.postgresql.org Subject: Re: Selecting strict, immutable text for a composite type. In-reply-to: <20180510103041.472408bb@wrkhors.com> References: <20180510103041.472408bb@wrkhors.com> Comments: In-reply-to Steven Lembark message dated "Thu, 10 May 2018 10:30:41 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20098.1525967568.1@sss.pgh.pa.us> Date: Thu, 10 May 2018 11:52:48 -0400 Message-ID: <20099.1525967568@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Steven Lembark 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