Questions tagged [postgresql-13]

Use this tag to indicate that your question is about PostgreSQL version 13. Questions concerning database administration should go to https://dba.stackexchange.com/

368 questions
0
votes
1 answer

postgresql logs dumping in table

I am dumping postgresql .csv file into a table but getting below error COPY postgres_log FROM 'C:\Program Files\PostgreSQL\13\data\log\postgresql-2021-06-15_191640.csv' WITH csv; ERROR: extra data after last expected column CONTEXT: COPY…
0
votes
1 answer

In what ways can I suffer data loss from a DROP VIEW .. CASCADE?

What potential non-obvious data loss can be caused by DROP VIEW xy CASCADE? I am using database migrations and as a feature I can have "repeatable migrations" - files containing SQL that get re-run every time after at least one new migration was…
Gregor Petrin
  • 2,891
  • 1
  • 20
  • 24
0
votes
1 answer

Get last 6 months but return 7 months records?

I'm trying to get rows for the last 6 months from a table. Here's the code: select "datetime" from "someTable" where "datetime" >= '2021-06-09 16:00:00'::timestamp - interval '6 months' and "datetime" <= '2021-06-09 16:00:00'::timestamp group by…
steve lee
  • 93
  • 7
0
votes
1 answer

plpgsql: a procedure that will do only update is returning ERROR: query has no destination for result data

I am trying to create a procedure (or a query) in plpgsql that will only be run once and here is what I've done so far: create or replace procedure transfer() LANGUAGE plpgsql as $$ declare cur refcursor; trans record; _datum…
Dejan Dozet
  • 948
  • 10
  • 26
0
votes
1 answer

postgreSQL 13: Starting the Database Server on windows 10

The documentation https://www.postgresql.org/docs/13/server-start.html offers this command: $ postgres -D /usr/local/pgsql/data But with this command I get the following error: Running the PostgreSQL server by a user with administrator rights is…
0
votes
1 answer

postgreSQL is shut down but pg_checksums still says clusters must be shut down

My postgreSQL database has been corrupted so that I'm trying to fix it with pg_checksum. I'm using docker with docker-compose, and docker-compose.yml seems like below. services: db: image: postgres volumes: -…
dobyek
  • 109
  • 1
  • 8
0
votes
0 answers

PostgreSQL VACUUM ANALYZE, invalid memory alloc request size

When I'm executing VACUUM (VERBOSE, ANALYZE) table_name; I get error ERROR: invalid memory alloc request size 2466264688 CONTEXT: while vacuuming index "idx_name" of relation "public.table_name" My maintenance_work_mem is 64mb, table contains…
Nikita Davydov
  • 837
  • 7
  • 18
0
votes
2 answers

How to set a value to sequence?

How to set value to sequence in plpgsql ? This fails in plpgsql select setval('public.student_id', select max(student_id) from public.student);
cofactor
  • 13
  • 6
0
votes
0 answers

Could not access the server :pgAdmin 4

services opened to change it automatic could not connect to server: Connection refused (0x0000274D/) Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
0
votes
1 answer

QPSQL driver not loaded (Qt6, Postgres-13)

I try to repeat QPSQL driver not loaded Qt but it does not helped me. I used x64 Postgresql and my Qt application also x64 m_dataBase.addDatabase("QPSQL"); m_dataBase.setHostName(g_hostName); m_dataBase.setPort(g_databasePort); …
0
votes
0 answers

How to avoid the 404 not found error with PostGreSQL13 and PGADMIN4

I'm trying to launch PGadmin4 with a PostgreSQL database but when I access http://localhost/pgadmin4, I keep landing on 127.0.0.1 refused to connect. After Postgresql, I launched the databased and the server seems to work: ~ sudo systemctl status…
NicolasRx
  • 29
  • 5
0
votes
3 answers

Can't import a CSV file into PostgreSQL

Summary I failed to import CSV files into a table on PostgreSQL. Even though it says that the import was successfully completed, there's no rows created. How did this happen, and how can I fix this? Thank you. Details 1. The CSV file I (failed to)…
Alice
  • 21
  • 1
  • 6
0
votes
0 answers

Postgres refuses to create a database - why?

I'm trying to create a database in PostgreSQL using this command: createdb -E UTF8 aws-inventories There are no errors from that command. But when I go to list the dbs the new database isn't there: postgres-# \l …
bluethundr
  • 1,005
  • 17
  • 68
  • 141
0
votes
1 answer

Copying Postgresql DB dump from remote server to local

I want to take a DB dump from a remote server and then copy this dump to my local. I tried couple of commands but didn't worked. Lastly I tried the command below; pg_dump -h 10.10.10.70 -p 5432 -U postgres -d mydb | gzip > db1.gz I succesffully…
yatta
  • 423
  • 1
  • 7
  • 22
0
votes
1 answer

Postgresql 13 64 bit and SSL

I have always used Postgresql Version 10, 32 bit with SSL, today I installed the Version 13, 64 bit, on a new Windows server and, if ssl is active, the service does not start anymore. I copied, as always, the certificate files, server.crt and…
Frank
  • 69
  • 15