Re: Improvements in prepared statements

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alejandro Sánchez <alex(at)nexttypes(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Improvements in prepared statements
Date: 2021-03-01 14:31:43
Message-ID: CAFj8pRCGKNkgZ1OFupGkg6HvMTkBrPRWRZpPq5z_R5Ci1yKpnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

po 1. 3. 2021 v 15:20 odesílatel Alejandro Sánchez <alex(at)nexttypes(dot)com>
napsal:

> Hello, some improvements in the prepared statements would facilitate
> their use from applications:
>
> - Use of table and column names in prepared statements.
>
> Example: select # from # where # = ?;
>
> - Use of arrays in prepared statements.
>
> Example: select # from article where id in (?);
>
> # = author,title
> ? = 10,24,45
>

The server side prepared statements are based on reusing execution plans.
You cannot reuse execution plans if you change table, or column. This is
the reason why SQL identifiers are immutable in prepared statements. There
are client side prepared statements - JDBC does it. There it is possible.
But it is impossible on the server side. Prepared statements are like a
compiled program. You can change parameters, variables - but you cannot
change the program.

Regards

Pavel

>
> Best regards.
> Alejandro Sánchez.
>
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2021-03-01 14:42:16 Re: proposal: psql –help reflecting service or URI usage
Previous Message Maxim Orlov 2021-03-01 14:22:27 SSL negotiation error on massive connect/disconnect