Re: How to execute the sql file in PSQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to execute the sql file in PSQL
Дата
Msg-id 1732342.1601913668@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to execute the sql file in PSQL  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: How to execute the sql file in PSQL  (Mark <jxustnc@gmail.com>)
Список pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 10/5/20 7:55 AM, Mark wrote:
>> I followed one PostgreSQL tutorial step by step. One session to use PSQL 
>> to execute sql files to create a new database in PostgreSQL.
>> 1.   copy  paste the sql file within "C:\Program Files\PostgreSQL\12"
>> directory.
>> 2.   execute the following code \i  C:\\Program
>> Files\\PostgreSQL\\12\\demo-big-en-20170815.sql 
>> 
>> Failed
>> The message shows C:: Permission denied

> The issue is the user you are running psql as does not have permissions 
> to read the file. This is a OS permissions thing. Either run psql as a 
> user that can read the file or change the permissions on the file to 
> those that allow the psql user to read it.

... or more likely, put the SQL file in a saner place.  Dropping random
files into a program directory can only lead to trouble.  You should
treat such directories as read-only unless you know exactly what you
are doing.

It seems likely to me that this failure stems from PG being installed
with permissions settings that prevent it from reading/modifying its own
executables, which is good solid security practice.

(If the tutorial actually told you to do that, the tutorial's author
is utterly clueless.)

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: "James B. Byrne"
Дата:
Сообщение: Re: UUID generation problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: UUID generation problem