Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> Since the encoding conversion now looks up database, it must be
> done within a transaction.
I still think that this is a fundamentally unworkable design. How will
you deal with reporting errors outside a transaction, or for that matter
inside an already-failed transaction?
ISTM the conversion function *must* be kept as a persistent state
variable, with an initial default of "no conversion", and the actual
setting done via a SET command (which can do the lookup inside a
transaction). Then you can use the current conversion function without
any assumptions about transaction state.
regards, tom lane