Re: [GENERAL] currval and DISCARD ALL

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, Nigel Heron <nigel(at)psycode(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] currval and DISCARD ALL
Date: 2013-04-19 14:58:21
Message-ID: CAFcNs+pEOb4oteyVX_mxxtcQfKOPnK2swaOGT=Lo-4yY3kCEog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Apr 19, 2013 at 11:12 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Fri, Apr 19, 2013 at 10:05 AM, Fabrízio de Royes Mello
> <fabriziomello(at)gmail(dot)com> wrote:
> > The attached wip patch do that and introduce a subcommand 'SEQUENCES',
> but
> > if we decide to don't add a new subcommand to DISCARD, then its easier to
> > modify the patch.
>
> This patch is quite wrong. It frees seqtab without clearing the
> pointer, so the next reference will stomp on memory that may have been
> reallocated. And it doesn't even free seqtab correctly, since it only
> frees the first node in the linked list.
>
>
Ohh sorry... you're all right... I completely forgot to finish the
ReleaseSequenceCaches to transverse 'seqtab' linked list and free each
node.

The attached patch have this correct code.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

Attachment Content-Type Size
discard_sequences.patch application/octet-stream 4.0 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2013-04-19 15:04:43 Re: [GENERAL] currval and DISCARD ALL
Previous Message Ian Harding 2013-04-19 14:27:18 Fwd: upgrading from V8.3.4 to V9.2.4

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2013-04-19 15:04:43 Re: [GENERAL] currval and DISCARD ALL
Previous Message Tom Lane 2013-04-19 14:46:43 Re: elog() error, trying CURENT OF with foreign table