Re: [HACKERS] proposal psql \gdesc - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] proposal psql \gdesc
Date
Msg-id alpine.DEB.2.20.1705080854380.3983@lancre
Whole thread Raw
In response to Re: [HACKERS] proposal psql \gdesc  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [HACKERS] proposal psql \gdesc  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Hello Pavel,

A complement to my previous comments:

> Also, maybe it would be better if the statement is cleaned up server side at 
> the end of the execution. Not sure how to achieve that, though, libpq seems 
> to lack the relevant function:-(
>
>  """although there is no libpq function for deleting a prepared
>  statement, the SQL DEALLOCATE statement can be used for that purpose."""
>
> Hmmm... I have not found how to use DEALLOCATE to cleanup an unnamed 
> statement, it does not allow a "zero-length" name. Maybe it could be extended 
> somehow, or a function could be provided for the purpose, eg
> by passing a NULL query to PQprepare...

After giving it some thoughts, I see three possible solutions:

0. Do nothing about it.   I would prefer the prepare is cleaned up.

1. assign a special name, eg "_psql_gdesc_", so that   DEALLOCATE "_psql_gdesc_" can be issued afterwards.

2. allow executing DEALLOCATE "";

3. add the missing PQdeallocate function to libpq?

Version 2 is server side, so it would not be compatible when connected 
to server running previous versions. Not desirable.

Version 3 may have implication at the protocol level and server side, if 
so it does not seem desirable to introduce such a change.

So maybe only version 1 is possible.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: [HACKERS] SUBSCRIPTIONS and pg_upgrade
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] transition table behavior with inheritance appearsbroken (was: Declarative partitioning - another take)