pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
User-defined print format for extension-defined types in psql output
3+ messages / 2 participants
[nested] [flat]

* User-defined print format for extension-defined types in psql output
@ 2017-12-14 21:21  Peter Devoy <peter@3xe.co.uk>
  0 siblings, 1 reply; 3+ messages in thread

From: Peter Devoy @ 2017-12-14 21:21 UTC (permalink / raw)
  To: 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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: User-defined print format for extension-defined types in psql output
@ 2017-12-15 09:59  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Peter Devoy <peter@3xe.co.uk>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2017-12-15 09:59 UTC (permalink / raw)
  To: Peter Devoy <peter@3xe.co.uk>; pgsql-general

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: User-defined print format for extension-defined types in psql output
@ 2017-12-16 19:49  Peter Devoy <peter@3xe.co.uk>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Devoy @ 2017-12-16 19:49 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-general

Thanks Laurenz.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-12-16 19:49 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 21:21 User-defined print format for extension-defined types in psql output Peter Devoy <peter@3xe.co.uk>
2017-12-15 09:59 ` Laurenz Albe <laurenz.albe@cybertec.at>
2017-12-16 19:49   ` Peter Devoy <peter@3xe.co.uk>

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