Re: Difference for Binary format vs Text format for client-server communication

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Difference for Binary format vs Text format for client-server communication
Дата
Msg-id b8ce18a6-f303-aa56-7565-fc7fcefb272a@2ndquadrant.com
обсуждение исходный текст
Ответ на Difference for Binary format vs Text format for client-server communication  (Andy Fan <zhihui.fan1213@gmail.com>)
Ответы Re: Difference for Binary format vs Text format for client-server communication  (Andy Fan <zhihui.fan1213@gmail.com>)
Список pgsql-hackers
On 2020-07-16 18:52, Andy Fan wrote:
> The reason I ask this is because I have a task to make numeric output
> similar to oracle.
> 
> Oracle:
> 
> SQL> select 2 / 1.0 from dual;
> 
>       2/1.0
> ----------
>           2
> 
> PG:
> 
> postgres=# select  2 / 1.0;
>        ?column?
> --------------------
>   2.0000000000000000
> (1 row)
> 
> If the user uses text format, I can just hack some numeric_out function, 
> but if they
> use binary format,  looks I have to change the driver they used for it.  
> Am I
> understand it correctly?

I think what you should be looking at is why the numeric division 
function produces that scale and possibly make changes there.  By the 
time the type's output or send function is invoked, that's already 
decided.  The output/send functions are not the place to make scale or 
other semantic adjustments.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Default setting for enable_hashagg_disk
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Default setting for enable_hashagg_disk