pgsql: Add fastpaths for when no objects are found

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add fastpaths for when no objects are found
Date: 2024-10-02 11:27:43
Message-ID: E1svxWB-001qYT-4N@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add fastpaths for when no objects are found

If there are no objects found, there is no reason to inspect the
result columns and mallocing a zero-sized (which will be 1 byte
in reality) heap buffer for it. Add a fast-path for immediately
returning like how other object inspection functions are already
doing it.

Reviewed-by: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Discussion: https://postgr.es/m/C2F05B3C-1414-45DD-AE09-6FEE4D0F89BD@yesql.se

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c733951049bf3993c886d7f2c7459e7439a9793

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-10-02 12:55:38 pgsql: doc: Missing markup, punctuation and wordsmithing
Previous Message Daniel Gustafsson 2024-10-02 10:31:36 pgsql: doc: Add link to login event trigger example