Issue I’m trying to import from CSV to Postgres and generate a uuid, uuid_generate_v4(), during the import to populate a table. Postgres version: 14 Postgres Table Country id (primary key) country_name country_ISO_Code Psql import \copy "Country" (select uuid_generate_v4() as "id",
Continue readingTag: psql
[SOLVED] Can't connect to my Docker Postgres from python suddenly
Issue I’ve been trying to configure my m1 to work with an older ruby on rails api and I think in the process I’ve broken my ability to connect any of my python apis to their database images in docker
Continue reading[SOLVED] SQL – FIlter out field names
Issue Is there a way to get only the value from the Select Query and not the field name? Ex: db=> select url from file where owner=’abc’ AND name=’xyz’; url ——————————————————— /abc/xyz.com (1 row) I just need ‘/abc/xyz.com’ and not
Continue reading[SOLVED] "stdin is not a tty" when populating Postgres database
Issue Please help, I have this stdin is not a tty message when i run the command below in my terminal. psql -U postgres kdc < kdc.psql kdc is the database and kdc.psql is the psql file with commands to
Continue reading[SOLVED] will pg_restore overwrite the existing tables?
Issue Say I have two host servers s1 and s2. In both the servers i have a schema named n1, now i have made some changes to some of the tables present in schema n1 of s1. I want the
Continue reading[SOLVED] Postgresql: Scripting psql execution with password
Issue How can I call psql so that it doesn’t prompt for a password? This is what I have: psql -Umyuser < myscript.sql However, I couldn’t find the argument that passes the password, and so psql always prompts for it.
Continue reading[SOLVED] cannot restart postgres cluster, because of non existant user id, cannot add user with that ID because it exist
Issue I am trying to restart my postgres cluster, but its supposed to be owned by user id that doesnt exist. when I try to add that user, its supposed to be existing. What can I do from here? [email protected]:~#
Continue reading[SOLVED] Exporting new line characters to text in Postgres
Issue There is a text field in a Postgres database containing new lines. I would like to export the content of that field to a text file, preserving those new lines. However, the COPY TO command explictly transforms those characters
Continue reading[SOLVED] How to browse django psql backend from command line?
Issue I’m developing a website with Django 3 (in a docker container) using postgres sql as the backend; i.e. in the project settings file I have: DATABASES = { ‘default’: { ‘ENGINE’: ‘django.db.backends.postgresql’, ‘NAME’: ‘postgres’, ‘USER’: ‘postgres’, ‘PASSWORD’: ‘postgres’, ‘HOST’:
Continue reading[SOLVED] PostgreSQL: Why psql can't connect to server?
Issue I typed psql and I get this: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? I used sudo netstat -nlp | grep 5432
Continue reading