Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)
Date: 2025-02-27 19:50:22
Message-ID: 202502271950.uzadrbkdkiax@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Feb-14, Ranier Vilela wrote:

> Attached is the prototype version v1.
> What do you think?

I think this is still a bit confused. The new function's comment says
"prepare the list of tables to ..." but what it really receives is a
list of _indexes_ (as evidenced by the fact that they're compared to
pg_index.indexrelid). So on input the user_list is an index list, and
on output it has been changed into a list of tables, and the list of
indexes is the function's return value? That seems quite weird. I
propose to change the API of this new function thus:

static void
get_parallel_tabidx_list(PGconn *conn,
SimpleStringList *index_list,
SimpleStringList *table_list,
bool echo);

where index_list is inout and the table_list is just an output argument.

I would also remove the 'type' argument, because I don't see a need to
keep it.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"After a quick R of TFM, all I can say is HOLY CR** THAT IS COOL! PostgreSQL was
amazing when I first started using it at 7.2, and I'm continually astounded by
learning new features and techniques made available by the continuing work of
the development team."
Berend Tober, http://archives.postgresql.org/pgsql-hackers/2007-08/msg01009.php

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-27 19:52:40 Re: SQLFunctionCache and generic plans
Previous Message Robert Haas 2025-02-27 19:41:05 Re: moving some code out of explain.c