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

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Difference for Binary format vs Text format for client-server communication
Дата
Msg-id CAKU4AWqi6PQwn4QQP0rzkXq8aL9zQwFdAXMy-Jq8dz4hBSPULg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Difference for Binary format vs Text format for client-server communication  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Hi:

Every pg_type has typinput/typoutput and typreceive/typsend 
they are used for text format and binary format accordingly.  What is
the difference between them in practice?  For example,  for a PG user,
shall they choose binary format or text format?  Actually I don't even
know how to set this in JDBC.  Which one is more common in real 
life and why? 

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?

--
Best Regards
Andy Fan

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Infinities in type numeric
Следующее
От: Alexey Kondratov
Дата:
Сообщение: Re: Partitioning and postgres_fdw optimisations for multi-tenancy