Sql error 58p01 error could not open file

I'm trying to import a CSV file into postgresql database. First of all I tried following query: copy temporaryData from '/home/milad/Desktop/myFolder/csvFiles/test.csv' delimiter ',' csv; But it g...

I’m trying to import a CSV file into postgresql database.
First of all I tried following query:

copy temporaryData
from '/home/milad/Desktop/myFolder/csvFiles/test.csv'
delimiter ',' csv;

But it gave me below Error:

SQL Error [42501]: ERROR: could not open file "/home/milad/Desktop/myFolder/test.csv" for reading: Permission denied

This error is reasonable as suggested by this thread and also by postgresql tutorial:

Notice that the file must be read directly by the PostgreSQL server, not by the client application. Therefore, it must be accessible by the PostgreSQL server machine. Also, you need to have superuser access in order to execute the COPY statement successfully.

Since I don’t like to change my system permissions just to import a file, To solve this issue I decided to move my CSV file to /tmp/ directory which is suggested by this answer.

Then I tried to run below script:

create or replace procedure loadInstructorOfCourses()
language plpgsql
as $$
begin 
    create table temporaryData(
        courseSectionID varchar(10),
        instructorID    varchar(25),
        courseTitle     varchar(50)
    );

    copy temporaryData
    from '/tmp/test.csv'
    delimiter ',' csv;

    drop table temporaryData;
end;$$;

call loadInstructorOfCourses();

And now it gives me below error:

SQL Error [58P01]: ERROR: could not open file "/tmp/test.csv" for reading: No such file or directory

But I’m sure the file has read permission for others and also it’s available:

> ls -l -d /tmp
drwxrwxrwt 25 root root 700 Oct 20 09:53 /tmp
> ls -l /tmp/test.csv
-rw-r--r-- 1 milad milad 6700 Oct 20 09:53 /tmp/test.csv

Why does this problem happen and how to resolve it?

INFO:
My OS is Manjaro KDE:

> uname -r
5.4.150-1-MANJARO

And also I use DBeaver to connect to postgresql server and run my scripts.

UPDATES: Using psql I have the same issue too. When I connect to db by psql:

psql -U postgres -d IUTPlanning

and run my procedure:

call loadInstructorOfCourses();

I’ll get the same error:

ERROR:  could not open file "/tmp/test.csv" for reading: No such file or directory
HINT:  COPY FROM instructs the PostgreSQL server process to read a file. You may want a client-side facility such as psql's copy.
CONTEXT:  SQL statement "copy temporaryData
        from '/tmp/test.csv'
        delimiter ',' csv"
PL/pgSQL function loadinstructorofcourses() line 9 at SQL statement

Problem

CDC for Postgresql : 11.4

Postgresql:11

When creating cdc for postgresql instance, got below error:

Cannot create changes:A SQL exception has occurred. The SQL error code is ‘0’. The SQL state is: 58P01. The error message is:

ERROR: could not access file «test_decoding»: No such file or directory

Symptom

Cannot create changes:A SQL exception has occurred. The SQL error code is ‘0’. The SQL state is: 58P01. The error message is:

ERROR: could not access file «test_decoding»: No such file or directory

Cause

You must install postgresql-contrib additional supplied modules on Your source endpoint.

Using below command to install, then re-create instance.

sudo yum install postgresql11-contrib

Environment

You must install postgresql-contrib additional supplied modules on Your source endpoint.

Using below command:

sudo yum install postgresql11-contrib

Then recreate instance.

Document Location

Worldwide

[{«Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Product»:{«code»:»SSTRGZ»,»label»:»InfoSphere Data Replication»},»Component»:»»,»Platform»:[{«code»:»PF016″,»label»:»Linux»}],»Version»:»11.4″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

Перейти к содержимому

У нас вдруг, то есть неожиданно, приболел VMware vCenter. Cимптомы были самые разнообразные:

  • бесконечные вылеты vCenter(300+);
  • вылеты update manager;
  • невозможность удалить ВМ — они становились orphaned;
  • невозможность удалить снапшоты/сделать консолидацию/клонировать ВМ.

Попытки обновить vCenter до последнего билда, откатиться на недельный бэкап не принесли успеха.

Зацепились за вылет VMware vCenter с ошибкой:

An unrecoverable problem has occurred, stopping the VMware VirtualCenter service. Error: Error[VdbODBCError] (1) «ODBC error: (58P01) — ERROR: could not open file «base/16384/26436«: No such file or directory;

Error while executing the query» is returned when executing SQL statement «DELETE FROM VPX_SDRS_STATS_VM WHERE VM_ID = ?»

Решили отработать по старой схеме — подключиться в СУБД vPostgres:

  • Из файла C:ProgramDataVMwarevCenterServercfgvmware-vpxvcdb.properties берем адрес и порт, которые слушает СУБД (localhost:5432),  имя пользователя (vc) и копируем в буфер обмена пароль.
  • Скачиваем и ставим PGAdmin.
  • Запускаем PGAdmin, вводим полученные ранее данные.

Раскрываем дерево: Servers->vCenter->Databases->VCDB->Schemas->vc->Tables->VPX_SDRS_STATS_VM и получаем:

ERROR: could not open file «base/16384/26436»

По правой кнопке мыши на таблице VPX_SDRS_STATS_VM->Scripts->CREATE Script.

Раскомментировать удаление таблицы и выполнить скрипт:

DROP TABLE vc.vpx_sdrs_stats_vm;

CREATE TABLE vc.vpx_sdrs_stats_vm

(

    vm_id integer NOT NULL,

    quantiles text COLLATE pg_catalog.«default»,

    history text COLLATE pg_catalog.«default»,

    space_stats text COLLATE pg_catalog.«default»,

    CONSTRAINT pk_vpx_sdrs_stats_vm PRIMARY KEY (vm_id)

)

WITH (

    OIDS = FALSE

)

TABLESPACE pg_default;

ALTER TABLE vc.vpx_sdrs_stats_vm

    OWNER to vc;

Таблица будет удалена и создана заново с пустыми данными.

Обращаю внимание, что если в таблицах находятся критические данные, то это может и не помочь. Данная же таблица это статистика SDRS по ВМ, что у меня не востребовано, да и vCenter сам периодически заполняет данные.

Не подскажете в чем причина?
При попытке создания базы:
Ошибка СУБД:
58P01: ERROR: could not open extension control file «/usr/share/pgsql/extension/mchar.control»: No such file or directory
База на Postgre при этом создаётся. Если повторить создание базы на 1С сервере, то получаем другую ошибку:
DATABASE не пригоден для использования
Версии софта:
ALT Server 10.0 + PostgreSQL 13.5 сборка для 1С ; 1С сервер 8.3.20.1789 или 8.3.17 на Windows 2008

russian

postgresql

it

database


8

ответов

Постгрес патченный для 1с?




Постгрес патченный для 1с?

он из родного репо, заявлен для 1С, устанавливал так
apt-get install postgresql13-1C-server


Максим MaxS

он из родного репо, заявлен для 1С, устанавливал …

Да я скачал его. Это какой-то огрызок. Там нет mchar


Максим MaxS

12-й попробовать?

Контриб пакет поставьте


Максим MaxS

он из родного репо, заявлен для 1С, устанавливал …

Из родного для чего?
14-й есть от ПГ Про


Dmitry Kononov

Из родного для чего?
14-й есть от ПГ Про

ALT Server 10.0 искал так
apt-cache search 1C-server

Это проблема установки расширения. В пг отсутствует тип mchar, без него 1ц работать не будет. Проблма решается дистро-специфично.

vCenter crashed and down with errors like the following. At this time, no one has deleted anything manually from the base directory. It just happened out of the blue. This is an incident happened of vCenter Appliance with Postgresql and not uncommon. If indexes were the only corruption, they can be identified and recreated and perhaps reindex will reconstruct the corrupted indexes (I have not personally tried this, just a logical thinking). My guess is, this works similar if index pg_toast missing. If tables involved in the corruptions and disappeared, it is not worth the time and would likely have data integrity issues. Work on a plan to restore up to the point where corruptions no longer showing. There are chances that the backup may inherit the same corruption. This corruption might be detectable with vacuum full.

2015-05-14T10:40:00.011-04:00 warning vpxd[08940] [Originator@6876 sub=Default] [VdbStatement] Execution elapsed time: 4 ms

2015-05-14T10:40:00.011-04:00 warning vpxd[08940] [Originator@6876 sub=Default] [VdbStatement] Statement diagnostic data from driver is 58P01:0:7:ERROR: could not open file «base/16384/26465»: No such file or directory;

—> Error while executing the query

2015-05-14T10:40:00.011-04:00 error vpxd[08940] [Originator@6876 sub=Default] [Vdb::IsRecoverableErrorCode] Unable to recover from 58P01:7

2015-05-14T10:40:00.011-04:00 error vpxd[08940] [Originator@6876 sub=Default] [VdbStatement] SQLError was thrown: «ODBC error: (58P01) — ERROR: could not open file «base/16384/26465»: No such file or directory;

—> Error while executing the query» is returned when executing SQL statement «select rule_topn1_proc()»

2015-05-14T10:40:00.012-04:00 warning vpxd[08940] [Originator@6876 sub=OsLayer_win32] [VpxUnhandledException] Win32 Exception (3765269347) detected at 000007fefd90aaad

To confirm with missing objects, use can locate it with ‘ls’ command or the following query.

SELECT pg_catalog.pg_relation_filenode(c.oid) as «Object ID», relname as «Object Name»,

case WHEN relkind=’r’ THEN ‘Table’ when relkind=’m’

THEN ‘Materialized View’ when relkind=’i’

THEN ‘Index’ when relkind=’S’

THEN ‘Sequence’ when relkind=’t’

THEN ‘Toast’ when relkind=’v’

THEN ‘View’ when relkind=’c’

THEN ‘Composite’ when relkind=’f’

THEN ‘Foreign_Table’

ELSE ‘other’ end as «Object Type», o.rolname as «Owner»

FROM pg_catalog.pg_class c

LEFT JOIN pg_catalog.pg_authid o ON o.oid=c.relowner

LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace

LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database(),

pg_catalog.pg_tablespace t

WHERE pg_catalog.pg_relation_filenode(c.oid) = 26465

Понравилась статья? Поделить с друзьями:
  • Spn 3225 fmi 10 ошибка двигателя лиаз
  • Spn 1761 fmi 18 камаз ошибка
  • Spn 792 fm1 5 код ошибки
  • Spn 171 fmi 3 камаз ошибка
  • Spn 791 fmi 5 ошибка камаз евро 4