Re: Trigger (C) question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Trigger (C) question
Дата
Msg-id 15833.962209244@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Trigger (C) question  ("Mitch Vincent" <mitch@venux.net>)
Список pgsql-general
"Mitch Vincent" <mitch@venux.net> writes:
> sprintf(query, "INSERT INTO %s (string, id) VALUES ($1, $2)", indexname);

> The above makes the query string, as I can see but what in the world is the
> $1 $2 and where did they come from?

Parameters.  The chunk of code you quote shows the plan being set up
with two parameters, the first of type VARCHAR and the second of type
OID (this allows the parser to know what datatype conversions it might
need to apply).  The actual values of the parameters will get passed to
the executor when the plan is executed, later on.  Too lazy to go
looking for the details right now...

            regards, tom lane

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

Предыдущее
От: Christophe Doré
Дата:
Сообщение: 2 phase commit
Следующее
От: Ted Nolan SRI Augusta GA
Дата:
Сообщение: Re: DateTime fields