Re: BUG #14104: PREPARE document has a missing parameter in one of the examples

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14104: PREPARE document has a missing parameter in one of the examples
Дата
Msg-id 23196.1461275415@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14104: PREPARE document has a missing parameter in one of the examples  (hus787@gmail.com)
Список pgsql-bugs
hus787@gmail.com writes:
> The second example here:
> http://www.postgresql.org/docs/9.4/static/sql-prepare.html

> ```
> PREPARE usrrptplan (int) AS
>     SELECT * FROM users u, logs l WHERE u.usrid=$1 AND u.usrid=l.usrid
>     AND l.date = $2;
> EXECUTE usrrptplan(1, current_date);
> ```

> `usrrptplan` should take in too arguments.

No, it's intentionally that way; the point of the example is to show
that you can let the parser infer the types of arguments if you like.
Note the subsequent para:

   Note that the data type of the second parameter is not specified,
   so it is inferred from the context in which $2 is used.

            regards, tom lane

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #14105: regression for right join - failed to build any 2-way joins
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14105: regression for right join - failed to build any 2-way joins