Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePmmF-0003r4-2g for pgsql-general@arkaria.postgresql.org; Fri, 15 Dec 2017 09:59:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePmmE-0007u9-Gm for pgsql-general@arkaria.postgresql.org; Fri, 15 Dec 2017 09:59:34 +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.84_2) (envelope-from ) id 1ePmmE-0007ty-6E for pgsql-general@lists.postgresql.org; Fri, 15 Dec 2017 09:59:34 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ePmm8-0004k9-JN for pgsql-general@postgresql.org; Fri, 15 Dec 2017 09:59:32 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 493C446E54; Fri, 15 Dec 2017 10:59:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id vMuqFvk4eXEM; Fri, 15 Dec 2017 10:59:22 +0100 (CET) Message-ID: <1513331960.2504.22.camel@cybertec.at> Subject: Re: User-defined print format for extension-defined types in psql output From: Laurenz Albe To: Peter Devoy , "Psql_General (E-mail)" Date: Fri, 15 Dec 2017 10:59:20 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Devoy wrote: > To make inspecting PostGIS tables in psql easier I have written a > function which outputs PostGIS Geometry objects as a string of ASCII > art. > > Please does anyone know if there is there some way I can have my > function called automatically by psql instead of me writing it into > the query each time? E.g. a user defined \pset option or some sort of > extension API which gives me access to the print logic or > 'presentation layer' of psql. > > By 'automatically' I mean through association with the PostGIS geometry types. All I can think of is changing the output function of the PostGIS data types, but that would require a C function. Yours, Laurenz Albe