Category "psql"

psql: how to exit with error if query returns 'False'?

I'm using psql to check if a table exists in a given database. The command below works fine to return t for True or f for False: psql -U $user -d $db -t -c "SEL

Cannot boot Chainlink: opening db: failed to open db:

When I "chainlink node start", I get the error: "Cannot boot Chainlink: opening db: failed to open db: failed to connect to host=/private/tmp user=myname databa

Unable to start PSQL in DigitalOcean

I am unable to connect to PSql from my DigitalOcean server. This happened after resizing the droplet. listen_addresses = '*' added to postgresql.conf host all a

django.db.utils.IntegrityError: null value in column "id" violates not-null constraint

I want to save data from the Django model to PostgreSQL database with: mymodel.objects.create(title='test') this model only has title and id but it raises th

Why doesn't Copy or \copy work for me in Pgsql?

I am trying to import data from a csv into postgres. I have tried the following and got the following errors: Copy TA_Files FROM 'C:\Users\ABla47\Documents\TA

How to execute psql command using ansible with variables

I am trying to run below task but it gives error. - name: Check if Schema exist shell: "psql -h {{ dbserver }} -U {{ dbuser } {{ dbname }} -c '\dt' | grep -

How to redistribute sum of specific months to another month via psql

I have a transactional table with year, month and amount. Now, there are months which we consider non-operating months (jan, feb, dec). However, SAP automatical

postgres C:: Permission denied using windows

I am using Windows 10 I have a PostgreSQL file when I run inside the PSQL CMD \i FILENAMEPATH postgres=# \i C:\Users\Asus\Desktop\Projects\Movies\solution.sql C

How to get definition/source code of an aggregate in PostgreSQL?

I found this related answer useful: Export "Create Aggregate" functions from PostgreSQL But how do I get the CREATE AGGREGATE statement without a GUI client (

Update a PostgreSQL field from the content of a file

I have a file containing a value which should go into a field of a PostgreSQL table. By searching a little, I found many answers, e.g. How can I update column v

PostgreSQL: encoding problems on Windows when using psql command line utility

I'm working in a centralized monitoring system on Windows 2008 R2, I have installed a PostgreSQL 9.3 to use psql from the command line. When I try to access to

PostgreSQL could not receive data from server: Software caused connection abort (0x00002745/10053)

I tried to establish a connection in pgAdmin to the PostgresSQL server. I always get the message: could not receive data from server: Software caused connectio

How to show data in a table by using psql command line interface?

Is there a way to show all the content inside a table by using psql command line interface? I can use \list to show all the databases, \d to show all the table

PostgreSQL: Show all the privileges for a concrete user

How to make a query to the Postgres data dictionary to find out all the privileges that a particular user has. I've been looking for a solution and I can not f

Display select results vertically in psql, as is done by MySQL's \G

In MySQL, you can terminate a select query with \G (as opposed to \g) to display the results vertically: select * from foo \G *************** id: 1 bar: Hell

psql: command not found Mac

I installed PostgreSQL via the graphical install on http://www.postgresql.org/download/macosx/ I see it in my applications and also have the psql terminal in m