Syntax for Postgres command

Das Goravani goravanis at
Fri Jan 28 17:53:57 UTC 2022

So I put my query into pgAdmin and got the following error when I do a \g to execute it:

ERROR:  syntax error at or near "FORMAT"
LINE 1: ...y_population )  FROM  '/Users/Shared/Cities.txt'  FORMAT CSV…

That’s what I’m getting now that I try to run it in pgAdmin.

I don’t know exactly which part it is having a problem with.

The file path precedes FORMAT … maybe it is referring to the file. I put it in /Users/Shared on Doug’s recommendation to do so. 

I thought it might be the csv I had in single quotes, so I took them off, still got the error, replaced lowercase csv with Uppercase, still got the error. 

The file has permissions set such that the current logged on user “server” and the Postgres system user both have read/write access to the file. 

I imagine it is having a problem with the file, as that directly precedes FORMAT word… 

But what should I do about the file?  

How do you capture an “Absolute Path” for the file… ?  Or do I already have an absolute path on it?  I don’t know how to recognize absolute verse relative.  I know both exist and are different. 

More information about the omnisdev-en mailing list