pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedCOPY FROM appears broken in PostgreSQL 15
3+ messages / 2 participants
[nested] [flat]
* COPY FROM appears broken in PostgreSQL 15
@ 2023-10-31 21:08 richard coleman <rcoleman.ascentgl@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: richard coleman @ 2023-10-31 21:08 UTC (permalink / raw)
To: pgsql-admin
Did something happen to the COPY FROM command in PostgreSQL 15?
I used to run scripts to process and load data from files into various
PostgreSQL tables. A series of:
copy {schema.table} from '/{path}/{file}' delimiter '|' null '' ;
in PostgreSQL 15 it fails with this message:
ERROR: could not open file "/{path}/{file}" for reading: Permission denied
HINT: COPY FROM instructs the PostgreSQL server process to read a file.
You may want a client-side facility such as psql's \copy.
I have checked and the postgres user can read/write to the file just fine.
In PostgreSQL < 15 it works just fine.
The official PostgreSQL docs, up to and including 16, don't mention a
problem with this command.
Did something happen?
Thanks,
rik.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: COPY FROM appears broken in PostgreSQL 15
@ 2023-10-31 21:11 Tom Lane <tgl@sss.pgh.pa.us>
parent: richard coleman <rcoleman.ascentgl@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2023-10-31 21:11 UTC (permalink / raw)
To: richard coleman <rcoleman.ascentgl@gmail.com>; +Cc: pgsql-admin
richard coleman <rcoleman.ascentgl@gmail.com> writes:
> Did something happen to the COPY FROM command in PostgreSQL 15?
It seems quite unlikely that you'd be the first to notice such
a fundamental problem.
> ERROR: could not open file "/{path}/{file}" for reading: Permission denied
> HINT: COPY FROM instructs the PostgreSQL server process to read a file.
> You may want a client-side facility such as psql's \copy.
> I have checked and the postgres user can read/write to the file just fine.
Check that again. Check lookup permission on all the directories in
the path, too.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: COPY FROM appears broken in PostgreSQL 15
@ 2023-10-31 21:19 Tom Lane <tgl@sss.pgh.pa.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2023-10-31 21:19 UTC (permalink / raw)
To: richard coleman <rcoleman.ascentgl@gmail.com>; +Cc: pgsql-admin
I wrote:
> richard coleman <rcoleman.ascentgl@gmail.com> writes:
>> I have checked and the postgres user can read/write to the file just fine.
> Check that again. Check lookup permission on all the directories in
> the path, too.
BTW, if you're on a selinux-enabled system (most Red-Hat-based
distros), you need to check file contexts too. Under selinux,
it's not uncommon for a daemon process to have fewer privileges
than the "same" user running an interactive session.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-10-31 21:19 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31 21:08 COPY FROM appears broken in PostgreSQL 15 richard coleman <rcoleman.ascentgl@gmail.com>
2023-10-31 21:11 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-10-31 21:19 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox