Re: when are the xxxin() functions called

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: when are the xxxin() functions called
Дата
Msg-id 554C0C92.6020000@lab.ntt.co.jp
обсуждение исходный текст
Ответ на when are the xxxin() functions called  (Rui Hai Jiang <ruihaijiang@msn.com>)
Список pgsql-hackers
On 2015-05-07 PM 11:49, Rui Hai Jiang wrote:
> 
> I'm trying to figure out when the following functions are called,
> 
> charin()
> int2in()
> int4in()
> textin()
> 
>   create table abcin( id integer, name varchar(10), title text);
>   insert into abcin( id, name, title ) values (1,'tom', 'manager');
> 
> The result is, textin() was called to handle 'manager' assigned to title, but
> charin(), int2in and int4in were not called.
> 
> Does anyone know when are charin(),int2in() and int4in() called?
> 

During parsing of the insert query, the values list (1,'tom', 'manager') is
transformed into an internal form during which it is determined that the first
value in the list can be represented as a machine integer - so it is evaluated
and stored for direct use later. Other literal values do not have such a
direct machine representation and require treatment (coercion to the target
type) using the input functions in later stages of query processing. By the
way, for the 'name' field, varcharin() would be used (not charin).

Thanks,
Amit




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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: commitfest app bug/feature
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: "Bugs" CF?