How do I install just the client tools for PostgreSQL on Windows?

后端 未结 6 461
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 02:16

I have a PostgreSQL database on a Linux system that I want to access from my Windows PC. But the only Windows binaries I have been able to find are the full installer, which

6条回答
  •  执笔经年
    2020-12-08 02:41

    Below are the steps I followed to connect to Amazon Redshift with postgres12 psql on windows:

    1. download postgres 12.4 from below location: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

    2. run the installer which will take few minutes and prompt you for installations options

    3. select command line tools as shown in below screenshot and install that

    4. Above will install postgres12 command line in below folder C:\Program Files\PostgreSQL\12\bin. Make sure to add this to your PATH environment variable

    5. open cmd and run command set PGCLIENTENCODING=UTF8

    6. run psql to connect to redshift. Make sure to change below parameters highlighted in red for your cluster endpoint, userid, copy script file name and log script file name respectively psql -h redshift-cluster-1.abcdefgh.us-east-1.redshift.amazonaws.com -U demo_user -d dev -p 5439 -f d:\demo\redshift_script.sql -L d:\demo\log_redshift_script.log

    7. all commands in redshift_script.sql file would get executed in PSQL and logs will be stored in log_redshift_script.log file

提交回复
热议问题