Aw: Additional accessors via the Extension API ? - Mailing list pgsql-general

From Karsten Hilbert
Subject Aw: Additional accessors via the Extension API ?
Date
Msg-id trinity-4455287d-6da1-4ee4-b4bb-447811798172-1645349006967@3c-app-gmx-bs31
Whole thread Raw
In response to Additional accessors via the Extension API ?  (Markur Sens <markursens@gmail.com>)
List pgsql-general
> Suppose  I have defined an additional type in a PG extension.
>
> Is it possible to add custom accessors to that type -much like jsonb does- but use an API/hook without touching the
corePG grammar & parser?  
>
> Hypothetical Examples:
>
> Assuming I have a TextFile type I’d like to implement syntax like:
>
> (‘/home/me/a.txt’::TextFile).firstline
> (‘/home/me/a.txt’::TextFile).lastline
> (‘/home/me/a.txt’::TextFile).countlines()
> (‘/home/me/a.txt’::TextFile).size()
> (‘/home/me/a.txt’::TextFile).datemodified()

Off on a tangent but would file_fdw help in any way ?

Karsten



pgsql-general by date:

Previous
From: Markur Sens
Date:
Subject: Additional accessors via the Extension API ?
Next
From: Julien Rouhaud
Date:
Subject: Re: Additional accessors via the Extension API ?