Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command. - Mailing list pgsql-hackers

From Kevin Hale Boyes
Subject Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.
Date
Msg-id CADAecHWWstByBh40wE_WXtsrSv31Ed5k+pD1QbRDXx06KuCgKw@mail.gmail.com
Whole thread Raw
Responses Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
My C is very rusty but the traversal of SeqTableData doesn't seem correct.
It saves the seqtab->next pointer into next, frees seqtab and then dereferences it.
Shouldn't that last line be: seqtab = next?

Kevin.

+/*
+ * Flush cached sequence information.
+ */
+void
+ResetSequenceCaches(void)
+{
+   SeqTableData *next;
+
+   while (seqtab != NULL)
+   {
+       next = seqtab->next;
+       free(seqtab);
+       seqtab = seqtab->next;
+   }



On 3 October 2013 14:23, Robert Haas <rhaas@postgresql.org> wrote:
Add DISCARD SEQUENCES command.

DISCARD ALL will now discard cached sequence information, as well.

Fabrízio de Royes Mello, reviewed by Zoltán Böszörményi, with some
further tweaks by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d90ced8bb22194cbb45f58beb0961251103aeff5

Modified Files
--------------
doc/src/sgml/ref/discard.sgml          |   12 +++++++++++-
src/backend/commands/discard.c         |    8 +++++++-
src/backend/commands/sequence.c        |   16 ++++++++++++++++
src/backend/parser/gram.y              |    9 ++++++++-
src/backend/tcop/utility.c             |    3 +++
src/bin/psql/tab-complete.c            |    2 +-
src/include/commands/sequence.h        |    1 +
src/include/nodes/parsenodes.h         |    1 +
src/test/regress/expected/sequence.out |    3 +++
src/test/regress/sql/sequence.sql      |    2 ++
10 files changed, 53 insertions(+), 4 deletions(-)


--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Any reasons to not move pgstattuple to core?
Next
From: Peter Geoghegan
Date:
Subject: Re: Any reasons to not move pgstattuple to core?