Syntax for Postgres command

Doug Easterbrook doug at artsman.com
Thu Jan 27 17:51:38 UTC 2022


postgres runs under a separate user on mac, windows and linux.   its is part of the security built into the database server.   it means you can’t fudge with it. ….   The database engine wont start if you alter the permissions on any of the postgers files — and this is all a very good thing.   it means you can trust the database.

It is not running under the ‘Das Goravani’ user log in.

so, if the file '/Users/server/Desktop/JS5Dev/Cities.txt’ is only accessible your use id, then no hope of postgres reading it whne you are asking postgres user to read the file.   


 at a minimum, you’d want to set the permission in the file to everyone read only .. 


Normally we put such files into /User/Shared/ since that directory on the mac is readonly to every one.






Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On January 27, 2022, at 9:12 AM, Das Goravani <goravanis at gmail.com> wrote:
> 
> 
> 
>> On Jan 27, 2022, at 12:10 PM, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
>> 
>> I always test major changes to SQL in pgadmin or psql first
>> 
>> if that works, then I’ll put in in an application.
>> 
>> 
>> it could be a permissions thing.  who knows if the database engine has access to '/Users/server/Desktop/JS5Dev/Cities.txt'
> 
> How do you check or set permissions for the database engine?
> 
> Should I log in as the Postgres system user that the installer created?
> 
> 
>> 
>> 
>> Doug Easterbrook
>> Arts Management Systems Ltd.
>> mailto:doug at artsman.com
>> http://www.artsman.com
>> Phone (403) 650-1978
>> 
>>> On January 27, 2022, at 9:07 AM, Das Goravani <goravanis at gmail.com> wrote:
>>> 
>>> 
>>> Do tStatObjPG.$execdirect("COPY fcCities ( cityname, city_count_num, city_cntry_num, long_deg, long_min, lat_deg, lat_min, long_we, lat_ns, city_rsn, city_state, ctime_zone, long_sec, lat_sec, city_acs_zone, city_acs_type, city_new, zone_we, city_ascii, city_alternate, city_latnum, city_Longnum, city_state_name, city_timezone_name, city_country_name, city_state_code, city_country_digits, city_acs, city_population )  FROM  '/Users/server/Desktop/JS5Dev/Cities.txt'  WITH  FORMAT 'csv', DELIMITER ',' “)
>>> 
>>> I tried the above command and it did nothing. It stepped right through it.
>>> 
>>> The file has 1.7 million city records in it. So it should take at least some time to execute. 
>>> 
>>> I am attempting to import the records into a Postgres database. 
>>> 
>>> I test and the statement object is good.
>>> 
>>> I am connected to localhost Postgres. I get a session object under the SQL Browser so I know I am connected.
>>> 
>>> I have made the table in question.
>>> 
>>> What could possibly be the reason for it just stepping through it without doing anything?
>>> 
>>> 
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list