User-defined print format for extension-defined types in psql output

From: Peter Devoy <peter(at)3xe(dot)co(dot)uk>
To: "Psql_General (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: User-defined print format for extension-defined types in psql output
Date: 2017-12-14 21:21:42
Message-ID: CABoFc_g9dD377C1_qtt9WE7KTL8HcUXu0iDbeEzgAOOaY4aUzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi list

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.

Example of how it looks at the moment: https://hastebin.com/nihujociga.sql

Kind regards

Peter

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hmidi slim 2017-12-14 22:08:30 Does the delete+insert is fater and less cpu consumer than update?
Previous Message Stephen Frost 2017-12-14 15:13:05 Re: pgstattuple free_percent to high