Add function to release an allocated SQLDA - Mailing list pgsql-hackers

From Kato, Sho
Subject Add function to release an allocated SQLDA
Date
Msg-id 25C1C6B2E7BE044889E4FE8643A58BA963A71BB2@G01JPEXMBKW03
Whole thread Raw
Responses Re: Add function to release an allocated SQLDA
List pgsql-hackers
Hi,

I add a function called ECPGfreeSQLDA() becasue there is no API for releasing the SQLDA stored the result set.

An example of usage is as follows.
Specify a pointer to sqlda_t to be released as an argument. 

Example:
  exec sql begin declare section;
          char    *stmt1 = "SELECT * FROM t1";
  exec sql end declare section;

  sqlda_t *outp_sqlda;

  exec sql prepare st_id2 from :stmt1;
  exec sql declare mycur2 cursor for st_id1;
  exec sql open mycur2;
  exec sql fetch all from mycur2 into descriptor outp_sqlda;
  exec sql close mycur2;
  exec sql deallocate prepare st_id2;
  ECPGfreeSQLDA(outp_sqlda);

The patch is attached.
The threads involved in this patch are as follows.

https://www.postgresql.org/message-id/25C1C6B2E7BE044889E4FE8643A58BA963A42097@G01JPEXMBKW03


https://www.postgresql.org/message-id/flat/0A3221C70F24FB45833433255569204D1F8AD5D6@G01JPEXMBYT05#0A3221C70F24FB45833433255569204D1F8AD5D6@G01JPEXMBYT05

regards,

--
Kato Sho


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: why partition pruning doesn't work?
Next
From: Andrew Gierth
Date:
Subject: Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"