Re: [HACKERS] A weird bit in pg_upgrade/exec.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] A weird bit in pg_upgrade/exec.c
Date
Msg-id 21596.1510244246@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] A weird bit in pg_upgrade/exec.c  (a.akenteva@postgrespro.ru)
Responses Re: [HACKERS] A weird bit in pg_upgrade/exec.c  (a.akenteva@postgrespro.ru)
List pgsql-hackers
a.akenteva@postgrespro.ru writes:
> I've came across a weird bit in pg_upgrade/exec.c

> We have a function check_bin_dir() which goes like this (old_cluster and 
> new_cluster are global variables):
> void check_bin_dir(ClusterInfo *cluster)
> {
>      ...
>      get_bin_version(&old_cluster);
>      get_bin_version(&new_cluster);
>      ...
> }

> This function has two calls:
> check_bin_dir(&old_cluster);
> check_bin_dir(&new_cluster);

> I'd like to substitute these last two lines with this:
> get_bin_version(cluster);

Yeah, the way it is now seems outright broken.  It will try to do
get_bin_version on the new cluster before having done validate_exec
there, violating its own comment.

I think we should change this as a bug fix, independently of whatever
else you had in mind to do here.
        regards, tom lane


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

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] A weird bit in pg_upgrade/exec.c
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] A weird bit in pg_upgrade/exec.c