Re: PostgreSQL 16 release announcement draft - Mailing list pgsql-hackers

From Jonathan S. Katz
Subject Re: PostgreSQL 16 release announcement draft
Date
Msg-id b172b11a-92b2-356e-7450-c801489ecfd9@postgresql.org
Whole thread Raw
In response to Re: PostgreSQL 16 release announcement draft  (jian he <jian.universality@gmail.com>)
Responses Re: PostgreSQL 16 release announcement draft
List pgsql-hackers
On 8/24/23 11:16 AM, jian he wrote:
> hi. Can you check my first email about "a" versus "the" and "pg_stat_activity".

I did when you first sent it, and did not make any changes.

> also:
> "including the `\bind` command, which allows
> users to execute parameterized queries (e.g `SELECT $1 + $2`) then use `\bind`
> to substitute the variables."
> 
> The example actually is very hard to reproduce. (it's not that super intuitive).
> fail case:
> test16-# SELECT $1 + $2 \bind 1 2
> test16-# ;
> 
> a better example would  be (e.g `SELECT $1 , $2`).
> The semicolon still needed to be in the next line.

I agree with updating the example, I'd propose:

SELECT $1::int + $2::int \bind 1 2 \g

which mirrors what's in the docs[1]

Thanks,

Jonathan

[1] 
https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-BIND

Attachment

pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: Disabling Heap-Only Tuples
Next
From: Chapman Flack
Date:
Subject: Re: PostgreSQL 16 release announcement draft