Please set up aliases for postgresql snaps


#1

Hi,

Can you please set up the following aliases for the following snaps. We would like to support users of Command Prompt’s (@iliv) postgresql snaps install a single copy of postgresql (e.g. postgresql10) with the familiar commands working (e.g. pgdump). They would also like to support the common case where users have multiple major versions of postgresql installed (e.g. postgresql10, postgresql96) and run commands prefixed (e.g. postgresql10.pgdump). In this case they want the major version to be explicitly attached to the command name, as it currently automatically is with separate postgresql snaps. This is because an embedded version number is closest to current user expectations. These users transitioning from a deb of postgresql are used to providing a full system path to the command which includes the version number.

Historical context: Auto-aliasing and duplicate aliases

postgresql10 snap:

clusterdb
createdb
createuser
dropdb
dropuser
ecpg
initdb
oid2name
pg_archivecleanup
pg_basebackup
pgbench
pg_config
pg_controldata
pg_ctl
pg_dump
pg_dumpall
pg_isready
pg_receivewal
pg_recvlogical
pg_resetwal
pg_restore
pg_rewind
pg_test_fsync
pg_test_timing
pg_upgrade
pg_waldump
postgres
postmaster
psql
reindexdb
vacuumdb
vacuumlo

postgresql96 snap:

clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
initdb
oid2name
pg_archivecleanup
pg_basebackup
pgbench
pg_config
pg_controldata
pg_ctl
pg_dump
pg_dumpall
pg_isready
pg_receivexlog
pg_recvlogical
pg_resetxlog
pg_restore
pg_rewind
pg_standby
pg_test_fsync
pg_test_timing
pg_upgrade
pg_xlogdump
pltcl_delmod
pltcl_listmod
pltcl_loadmod
postgres
postmaster
psql
reindexdb
vacuumdb
vacuumlo

postgresql95 snap:

clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
initdb
oid2name
pg_archivecleanup
pg_basebackup
pgbench
pg_config
pg_controldata
pg_ctl
pg_dump
pg_dumpall
pg_isready
pg_receivexlog
pg_recvlogical
pg_resetxlog
pg_restore
pg_rewind
pg_standby
pg_test_fsync
pg_test_timing
pg_upgrade
pg_xlogdump
pltcl_delmod
pltcl_listmod
pltcl_loadmod
postgres
postmaster
psql
reindexdb
vacuumdb
vacuumlo

postgresql94 snap:

clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
initdb
oid2name
pg_archivecleanup
pg_basebackup
pgbench
pg_config
pg_controldata
pg_ctl
pg_dump
pg_dumpall
pg_isready
pg_receivexlog
pg_recvlogical
pg_resetxlog
pg_restore
pg_standby
pg_test_fsync
pg_test_timing
pg_upgrade
pg_xlogdump
pltcl_delmod
pltcl_listmod
pltcl_loadmod
postgres
postmaster
psql
reindexdb
vacuumdb

postgresql93 snap:

clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
initdb
oid2name
pg_archivecleanup
pg_basebackup
pgbench
pg_config
pg_controldata
pg_ctl
pg_dump
pg_dumpall
pg_isready
pg_receivexlog
pg_resetxlog
pg_restore
pg_standby
pg_test_fsync
pg_test_timing
pg_upgrade
pg_xlogdump
pltcl_delmod
pltcl_listmod
pltcl_loadmod
postgres
postmaster
psql
reindexdb
vacuumdb
vacuumlo


#2

We’re discussing this in person, and wondering if we can use tracks


#3

Thanks-- please circle back to this topic since I’m a little confused by what precisely is desired from the the request.


#4

Yes, we’re going to try to move PostgreSQL under a single snap first. I’ll modify this request to cover the single snap with tracks, once we have that in place.


#5

Okay, we’ve settled on a single postgresql snap with tracks, as described in Please create tracks for postgres snap.

That narrows down the list of aliases we need for postgresql to the following:

clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
initdb
oid2name
pg_archivecleanup
pg_basebackup
pg_config
pg_controldata
pg_ctl
pg_dump
pg_dumpall
pg_isready
pg_receivewal
pg_receivexlog
pg_recvlogical
pg_resetwal
pg_resetxlog
pg_restore
pg_rewind
pg_standby
pg_test_fsync
pg_test_timing
pg_upgrade
pg_waldump
pg_xlogdump
pgbench
pltcl_delmod
pltcl_listmod
pltcl_loadmod
postgres
postmaster
psql
reindexdb
vacuumdb
vacuumlo

These are all commands people normally associate with PostgreSQL. I think it’s reasonable that they not have to type postgresql.postgres to reach them.

We’ll be adding a few more once finished snapping PostgreSQL 11.


#6

There are two more commands in PostgreSLQ 11.0:

pg_verify_checksums
pg_standby

#7

There are the essential tools that Postgres users will expect to have available :+1: from me


#8

How is this request affected, if at all, by: //forum.snapcraft.io/t/please-create-tracks-for-postgres-snap/8348/7


#9

Ping @evan - I don’t know how to proceed at this point.


#10

@jdstrand The request for aliases is to add the following outlined here: Please set up aliases for postgresql snaps

These are common for all Postgres versions, so should be created.

clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
initdb
oid2name
pg_archivecleanup
pg_basebackup
pg_config
pg_controldata
pg_ctl
pg_dump
pg_dumpall
pg_isready
pg_receivewal
pg_receivexlog
pg_recvlogical
pg_resetwal
pg_resetxlog
pg_restore
pg_rewind
pg_standby
pg_test_fsync
pg_test_timing
pg_upgrade
pg_waldump
pg_xlogdump
pgbench
pltcl_delmod
pltcl_listmod
pltcl_loadmod
postgres
postmaster
psql
reindexdb
vacuumdb
vacuumlo

However, for the 11/ track these additional aliases are required.

pg_verify_checksums
pg_standby

@sparkiegeek Is it possible to defined aliases per track?


#11

It is not; aliases are global for the snap.

One way to handle this would be to ensure all the aliased commands exist even on 9.x and 10.0 snaps, but on those versions, the commands that are 11-only could be placeholders that do nothing (would be nice if they explained why).


#12

@jdstrand I like the sound of @roadmr’s idea above. Your thoughts on Postgres snaps < 11 carrying stubs for the pg_verify_checksums and pg_standby commands that explains why they don’t do anything?


#13

FWIW if a snap doesn’t provide the command for which an alias exists, snapd handles it ok.


#14

2 votes for, 0 against. This is now live.