pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14104: PREPARE document has a missing parameter in one of the examples
2+ messages / 2 participants
[nested] [flat]

* BUG #14104: PREPARE document has a missing parameter in one of the examples
@ 2016-04-20 13:06  hus787@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: hus787@gmail.com @ 2016-04-20 13:06 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14104
Logged by:          Hussain Parsaiyan
Email address:      hus787@gmail.com
PostgreSQL version: 9.5.2
Operating system:   MacOSX
Description:        

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.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #14104: PREPARE document has a missing parameter in one of the examples
@ 2016-04-21 21:50  Tom Lane <tgl@sss.pgh.pa.us>
  parent: hus787@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2016-04-21 21:50 UTC (permalink / raw)
  To: hus787@gmail.com; +Cc: 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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-04-21 21:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 13:06 BUG #14104: PREPARE document has a missing parameter in one of the examples hus787@gmail.com
2016-04-21 21:50 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox