Re: string function - "format" function proposal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: string function - "format" function proposal
Date
Msg-id 26947.1283783309@sss.pgh.pa.us
Whole thread Raw
In response to Re: string function - "format" function proposal  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> Why I think so this is useful - sometimes people asked some GUC for
> formatting date, boolean and other. If these functions try to use a
> cast to text first, then there is some space for customization via
> custom cast functions.

This is basically nonsense.  If you don't control a type's output
function, you don't control its cast to text either.  Nor do I think
it's a good idea to encourage people to make their casts to text operate
differently from their output functions.  We have that one wart in
boolean casting because the SQL standard specifies the result of cast to
text and it's different from our historical practice in the bool output
function --- but it is a wart, not something we should encourage people
to emulate.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: string function - "format" function proposal
Next
From: Itagaki Takahiro
Date:
Subject: Re: string function - "format" function proposal