A
A
Anton2018-11-28 12:41:38
PHP
Anton, 2018-11-28 12:41:38

\. in sql file?

Hello. I did a database dump, it has this line:

COPY public.tbl (id, score, user_id, created_at, updated_at)
FROM stdin;
\.

If the dump is imported using the pgsql utility, everything works fine, but if through the php utility that reads the file and executes queries using pdo, it swears at \.
Please tell me what does \ mean. and how to win it in php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2018-11-28
Reytarovsky @Antonchik

using the pgsql utility

I don't know those. What is this utility, what does it do, how does it do it?
This marks the end of the data for COPY. https://www.postgresql.org/docs/current/sql-copy.html
emnip, php can't copy from stdin as queries at all, only as PDO::pgsqlCopyFromArray functions for PDO or pg_put_line, pg_end_copy for php-postgresql extension.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question