pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Peter Devoy <peter@3xe.co.uk>
To: Psql_General (E-mail) <pgsql-general@postgresql.org>
Subject: Re: User-defined print format for extension-defined types in psql output
Date: Fri, 15 Dec 2017 10:59:20 +0100
Message-ID: <1513331960.2504.22.camel@cybertec.at> (raw)
In-Reply-To: <CABoFc_g9dD377C1_qtt9WE7KTL8HcUXu0iDbeEzgAOOaY4aUzQ@mail.gmail.com>
References: <CABoFc_g9dD377C1_qtt9WE7KTL8HcUXu0iDbeEzgAOOaY4aUzQ@mail.gmail.com>

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




view thread (3+ messages)  latest in thread

Message-ID: <1513331960.2504.22.camel@cybertec.at>
Permalink:  ../1513331960.2504.22.camel@cybertec.at/
Also on:    postgresql.org/message-id/1513331960.2504.22.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, peter@3xe.co.uk
  Subject: Re: User-defined print format for extension-defined types in psql output
  In-Reply-To: <1513331960.2504.22.camel@cybertec.at>
  References: <CABoFc_g9dD377C1_qtt9WE7KTL8HcUXu0iDbeEzgAOOaY4aUzQ@mail.gmail.com> <1513331960.2504.22.camel@cybertec.at>

* 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