Thread: Update Old Version Public Keys?

Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
Hello Apters,

I noticed while making tests for an extension that supports older versions of PostgreSQL that the public keys for the
8.4and 9.1 (but not 9.0) repos are out-of-date. Some details here: 

  https://github.com/docker-library/postgres/issues/737

Any chance they could be updated? I realize that the community had dropped support for 9.4 and earlier, but as long as
thereare repos, perhaps the keys should be kept up-to-date? 

Thanks,

David


Attachment

Re: Update Old Version Public Keys?

From
Christoph Berg
Date:
Re: David E. Wheeler
> Hello Apters,
> 
> I noticed while making tests for an extension that supports older versions of PostgreSQL that the public keys for the
8.4and 9.1 (but not 9.0) repos are out-of-date. Some details here:
 
> 
>   https://github.com/docker-library/postgres/issues/737
> 
> Any chance they could be updated? I realize that the community had dropped support for 9.4 and earlier, but as long
asthere are repos, perhaps the keys should be kept up-to-date?
 

Hi,

I left a comment in the github issue.

Christoph



Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
On Jun 8, 2020, at 10:28, Christoph Berg <myon@debian.org> wrote:

> I left a comment in the github issue.

Thanks Christoph!

D



Attachment

Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
On Jun 8, 2020, at 20:42, David E. Wheeler <david@justatheory.com> wrote:

> On Jun 8, 2020, at 10:28, Christoph Berg <myon@debian.org> wrote:
>
>> I left a comment in the github issue.
>
> Thanks Christoph!

Well that was unsatisfying. So I made a new Docker image, pgxn/pgxn-tools:

  https://github.com/pgxn/docker-pgxn-tools

Works very well, except for Postgres 13 (and presumably future pre-releases). Is there some incantation I could put
intothe Dockerfile to permanently configure it to ready from the prerelease repo, too? Sorry for the newb question, I’m
onlya superficial apt user. 

Thanks,

David



Attachment

Re: Update Old Version Public Keys?

From
Christoph Berg
Date:
Re: David E. Wheeler
> Works very well, except for Postgres 13 (and presumably future pre-releases). Is there some incantation I could put
intothe Dockerfile to permanently configure it to ready from the prerelease repo, too? Sorry for the newb question, I’m
onlya superficial apt user.
 

PG13 requires an extra "13" added to the sources.list entry:

https://wiki.postgresql.org/wiki/Apt/FAQ#I_want_to_try_the_beta_version_of_the_next_PostgreSQL_release

There's a shell script to automate these bits in postgresql-common 204
or newer:

/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v 13

https://salsa.debian.org/postgresql/postgresql-common/-/blob/master/pgdg/apt.postgresql.org.sh

(Unfortunately, buster has only version 200, so you'd need to install
postgresql-common from buster-pgdg first, but if you do that, you have
a trust path from buster via buster-pgdg to PG13 without fetching
random things via wget.)

Christoph



Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
> There's a shell script to automate these bits in postgresql-common 204
> or newer:
>
> /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v 13
>
> https://salsa.debian.org/postgresql/postgresql-common/-/blob/master/pgdg/apt.postgresql.org.sh

Okay. I’m doing this:

ADD  https://www.postgresql.org/media/keys/ACCC4CF8.asc .
RUN apt-key add ACCC4CF8.asc \
    && rm ACCC4CF8.asc \
    && echo deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main > /etc/apt/sources.list.d/pgdg.list

This is so that the container can install any supported version (except 13). Is it possible to have both? Should I grab
apt.postgresql.org.shand use it to set up both the normal repo *and* for 13? Something like: 

ADD https://salsa.debian.org/postgresql/postgresql-common/-/blob/master/pgdg/apt.postgresql.org.sh \
    && apt.postgresql.org.sh \
    && /apt.postgresql.org.sh -v 13

And then would it support `apt-get install postgresql-13`?

Thanks,

David


Attachment

Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
On Jun 14, 2020, at 16:06, David E. Wheeler <david@justatheory.com> wrote:

> ADD https://salsa.debian.org/postgresql/postgresql-common/-/blob/master/pgdg/apt.postgresql.org.sh \
>    && apt.postgresql.org.sh \
>    && /apt.postgresql.org.sh -v 13
>
> And then would it support `apt-get install postgresql-13`?

Okay, I changed it to:

```
ADD https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/apt.postgresql.org.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/apt.postgresql.org.sh \
    && apt-get update \
    && apt-get install -y --no-install-recommends build-essential pgxnclient ca-certificates gnupg2 \
    && apt-get clean
```

And then I added code to my start script to call

    apt.postgresql.org.sh -p -v $PGVERSION

However, when I try to install 13, I get:

```
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-13 : Depends: postgresql-client-13 but it is not going to be installed
 postgresql-server-dev-13 : Depends: libpq-dev (>= 13~~) but 11.7-0+deb10u1 is to be installed
                            Depends: postgresql-client-13 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
```

Is there something else that needs doing?

Thanks,

David


Attachment

Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
On Jun 14, 2020, at 17:54, David E. Wheeler <david@justatheory.com> wrote:

> Okay, I changed it to:
>
> ```
> ADD https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/apt.postgresql.org.sh /usr/local/bin/
> RUN chmod +x /usr/local/bin/apt.postgresql.org.sh \
>    && apt-get update \
>    && apt-get install -y --no-install-recommends build-essential pgxnclient ca-certificates gnupg2 \
>    && apt-get clean
> ```
>
> And then I added code to my start script to call
>
>    apt.postgresql.org.sh -p -v $PGVERSION
>
> However, when I try to install 13, I get:
>
> ```
> Some packages could not be installed. This may mean that you have
> requested an impossible situation or if you are using the unstable
> distribution that some required packages have not yet been created
> or been moved out of Incoming.
> The following information may help to resolve the situation:
>
> The following packages have unmet dependencies:
> postgresql-13 : Depends: postgresql-client-13 but it is not going to be installed
> postgresql-server-dev-13 : Depends: libpq-dev (>= 13~~) but 11.7-0+deb10u1 is to be installed
>                            Depends: postgresql-client-13 but it is not going to be installed
> E: Unable to correct problems, you have held broken packages.
> ```
>
> Is there something else that needs doing?

Hello gang. I tried this again today, now that 13.0 is out, and get the same errors. Do I need to do something
differentthan I did for 12 and earlier? Example: 

  https://github.com/theory/pg-semver/runs/1239421317

Thanks,

David


Attachment

Re: Update Old Version Public Keys?

From
Christoph Berg
Date:
Re: David E. Wheeler
> > Okay, I changed it to:
> > 
> > ```
> > ADD https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/apt.postgresql.org.sh /usr/local/bin/

> Hello gang. I tried this again today, now that 13.0 is out, and get the same errors. Do I need to do something
differentthan I did for 12 and earlier? Example:
 
> 
>   https://github.com/theory/pg-semver/runs/1239421317

| + apt.postgresql.org.sh -p -v 13
| This script will enable the PostgreSQL APT repository on apt.postgresql.org on
| your system. The distribution codename used will be buster-pgdg-testing.

Is that the latest version of the apt.postgresql.org.sh script? It
should only use "-testing" when passed -t.

Christoph



Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
On Oct 13, 2020, at 11:15, Christoph Berg <myon@debian.org> wrote:

> Thanks, I just pushed fix.
>
> I still don't have a smart way to automate that, though :(

That fixes it, thanks.

Now, if I wanted to test Postgres 14 (dev), what additional steps would I have to take?

Thanks,

David



Attachment

Re: Update Old Version Public Keys?

From
Christoph Berg
Date:
Re: David E. Wheeler
> That fixes it, thanks.
> 
> Now, if I wanted to test Postgres 14 (dev), what additional steps would I have to take?

sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v 14 -i

The PG14 packages currently have a bug in the "alternatives" handling
for the manpages which prevents installation. I'll try to fix that
now. (Or revert the breaking change.)

Christoph



Re: Update Old Version Public Keys?

From
Christoph Berg
Date:
Re: To David E. Wheeler
> sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v 14 -i
> 
> The PG14 packages currently have a bug in the "alternatives" handling
> for the manpages which prevents installation. I'll try to fix that
> now. (Or revert the breaking change.)

Fwiw, the packages have been fixed now.

Christoph



Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
On Oct 13, 2020, at 14:44, Christoph Berg <myon@debian.org> wrote:

>> Now, if I wanted to test Postgres 14 (dev), what additional steps would I have to take?
>
> sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v 14 -i

For some reason it doesn’t work:

  https://github.com/theory/pg-semver/runs/1269694601?check_suite_focus=true

That’s running

PGVERSION=14
apt.postgresql.org.sh -p -v $PGVERSION
packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common"
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y $packages

Working fine on v13 and earlier.

Thanks,

David


Attachment

Re: Update Old Version Public Keys?

From
Aaron Pavely
Date:
On Sat, Oct 17, 2020 at 6:30 PM David E. Wheeler <david@justatheory.com> wrote:
On Oct 13, 2020, at 14:44, Christoph Berg <myon@debian.org> wrote:

>> Now, if I wanted to test Postgres 14 (dev), what additional steps would I have to take?
>
> sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v 14 -i

For some reason it doesn’t work:

  https://github.com/theory/pg-semver/runs/1269694601?check_suite_focus=true

That’s running

PGVERSION=14
apt.postgresql.org.sh -p -v $PGVERSION
packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common"
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y $packages

Working fine on v13 and earlier.

Thanks,

David

This is back to the release pin priority issue. PG14 is only available in the testing release, and the testing release's pin priority does not permit use without explicit enabling, i.e., use of apt-get option `-t <release-codename>-pgdg-testing`.

Alternatively, skip the `apt-get` and simply use apt.postgresql.org.sh's `-i` option to install, if you can accept it overwriting any existing PostgreSQL configuration files, since it would achieve the same package set installation goal.

-- Aaron

Re: Update Old Version Public Keys?

From
"David E. Wheeler"
Date:
On Oct 17, 2020, at 20:58, Aaron Pavely <aaron@pavely.net> wrote:

> Alternatively, skip the `apt-get` and simply use apt.postgresql.org.sh's `-i` option to install, if you can accept it
overwritingany existing PostgreSQL configuration files, since it would achieve the same package set installation goal. 

Would that get me the server-dev package, too?

Thanks,

David


Attachment

Re: Update Old Version Public Keys?

From
Aaron Pavely
Date:
On Sat, Oct 17, 2020 at 8:00 PM David E. Wheeler <david@justatheory.com> wrote:

On Oct 17, 2020, at 20:58, Aaron Pavely <aaron@pavely.net> wrote:

> Alternatively, skip the `apt-get` and simply use apt.postgresql.org.sh's `-i` option to install, if you can accept it overwriting any existing PostgreSQL configuration files, since it would achieve the same package set installation goal.

Would that get me the server-dev package, too?

Thanks,

David

Yes, because the repository component '14' is specified as part of the value for $COMPONENTS when the repository installation is done by the apt.postgresql.org.sh script, here:

If, instead, the `-i` option is used, the $PIN value assigned is used later by `apt-get`, here:
https://salsa.debian.org/postgresql/postgresql-common/-/blob/32702b6cd4c50b8da9484f5f0a189a6db3ef79a4/pgdg/apt.postgresql.org.sh#L247-249

-- Aaron