Re: Using textin/textout vs. scribbling around

From: Brook Milligan <brook(at)biology(dot)nmsu(dot)edu>
To: peter_e(at)gmx(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using textin/textout vs. scribbling around
Date: 2001-08-15 15:54:53
Message-ID: 200108151554.JAA21247@biology.nmsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am tempted to replace all attempts to build text data on your own (with
VARDATA, VARHDRSZ, etc.) with proper calls to textin/textout in all places
that can't claim to be truly internal (especially all contrib). The
background is that the internal format might change sometime when more
locale features are implemented (see recent idea). Is this a good idea?

I would be in favor of this for the following reasons. One of the
great advantages of PostgreSQL is that adding new types is relatively
straightforward. In many cases new types could be coded largely in
terms of preexisting types. An example I am facing currently involves
the problem of constructing basically a TEXT type with rather unusual
parsing and output semantics. If a reasonably well-encapsulated
version of the TEXT type existed--including header files with the
right granularity and with the right functions provided in an
installed library--the natural means of providing the new type we need
would be to simply define a type with different *in/*out functions
implemented over an instance of the TEXT internal data
representation.

Peter's suggestion appears to be a natural step towards the goal of
being able to provide a defined interface that could be used for
extensions. The concern that the _external_ format might change seems
counter to the effort of providing a stable platform for extending
PostgreSQL. If there is a serious possibility that this might occur,
and because of that we cannot provide any external interface to the
predefined types, then the well-known advantages of composing software
modules from well-defined and well-tested components will be largely
lost for anyone wishing to rapidly extend the system.

Cheers,
Brook

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-08-15 16:09:37 Re: PostGIS spatial extensions
Previous Message Bruce Momjian 2001-08-15 15:43:01 Re: Re: To be 7.1.3 or not to be 7.1.3?