PrismaP
Prisma9mo ago
4 replies
stevep

ERROR: COPY to a file is not supported

I am working on a prisma postgres TEMP table, and want to export it for use on another server.
I am using a SQL COPY command through prisma.$queryRawUnsafe(), the command is
COPY "Meeting_temp" to '/tmp/fastLoadCopyMeeting_temp.2025-05-19T16:53:24.772+00:00.rows'
This works fine on my Mac, but in AWS (AWS GNU Linux), I get a

PrismaClientKnownRequestError:
Invalid prisma.$queryRawUnsafe() invocation:
Raw query failed. Code: 0A000. Message: ERROR: COPY to a file is not supported HINT: Anyone can COPY to stdout or from stdin. psql's \\copy command also works for anyone.\

I don't believe that psql is a viable option for a TEMP file, which is created within a specific session.

Does this 0A000 error mean that I am having access problems to the /tmp directory, or does it really
mean 'COPY to a file is not supported' on our AWS instance, but not on my Mac?

-------------------
"prisma": "6.5.0",
(PostgreSQL) 14.17
Was this page helpful?