cli
cli copied to clipboard
fix: ignore psqlrc entirely in psql
This will make users with \timing on
in .psqlrc on PG 12+ happy
because it does not ignore the psqlrc with -c anymore.
The option -X
is available since PG 7.1, PG 12 changed the -c
to not ignore psqlrc by default.
Ping.
Ping.
@sobrinho would you elaborate on what you are wanting to maintain or change here? I've had a few of us look and we're all a bit confused on your expectation (our fault!).
@RasPhilCo until pg 11, using -c would make psql ignore the ~/.psqlrc.
But since pg 12, -c doesn't ignore it anymore, you need to explicitly use -X.
The good thing is that -X exists since pg 7.1 for this, we don't need to worry about backward incompatibility with ancient pgs.
@RasPhilCo maybe I forgot to mention why we need this 🤦
This is to avoid this output when we use heroku pg:pull
:
▸ WARNING: Extensions in newly created target database differ from existing source database.
▸ Target extensions:
▸ extname
▸ -----------
▸ pgcrypto
▸ plpgsql
▸ unaccent
▸ uuid-ossp
▸ (4 rows)
▸
▸ Time: 1.153 ms
▸
▸ Source extensions:
▸ extname
▸ -----------
▸ pgcrypto
▸ plpgsql
▸ unaccent
▸ uuid-ossp
▸ (4 rows)
▸
▸ Time: 138.152 ms
▸
▸ HINT: You should review output to ensure that any errors
▸ ignored are acceptable - entire tables may have been missed, where a dependency
▸ could not be resolved. You may need to to install a postgresql-contrib package
▸ and retry.
But that message only appears because I have \timing on
in my .psqlrc
and that's the only difference the query of the extensions in Heroku and my local database after pulling.
@RasPhilCo do you understand what this PR is trying to accomplish yet (regain ability to ignore .psqrc file when sending commands)?
Do we know what is left to get compliance to sign off on the PR?