-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter 4 Exporting #14
Comments
Hi, @anthonysim ... This can happen if PostgreSQL doesn't have rights to the folder where you're either reading or writing a file. I would suggest two things:
Please let me know if that solves the issue. Also, let me know which version of Windows you're on. |
Thanks @anthonydb, I appreciate it! It worked and I am using Windows 10. |
Glad to hear it. I'll keep this issue open in case others run into the same question. |
Hi @anthonydb I am having a similar issue concerning but with the import of the CSV file (see error message below). I am trying to import the file from a new folder I created on my Mac desktop for which I changed the permissions to write & read (although permission to read should be sufficient) and I did the same for the CSV file itself (read & write). No matter what I try I still get the same error message: ERROR: could not open file "/namepath/us_counties_2010.csv" for reading: Permission denied |
Hi, @PaulusJS, Unusual for a Mac. How did you install PostgreSQL? |
Is it just me, or are area_land in the CSV floats whaereas area_land is data type bigint? Perhaps that's for didactic purpose and I just need to keep reading? eg. line 72 'bethel..' and line 86 'north slope' Well, I got it copied. I must have let Excel get it's hooks into the numbers. I didn't realize maintaining pure csv in excel was still fraught with danger. Dragged it straight from the directory to the raspberry pi and it worked perfectly. Kind regards. |
@crawfordniche After the first printing of the book, we added a note on page xxviii in the Introduction that says: The repository also contains the public data you’ll use in the exercises. Avoid opening or changing these files with Excel or a text editor, which can lead to data loss or encoding changes. I explain why this is problematic in “Checking for Malformed Values Using length()” on page 135. |
|
@ayangupta-dotcom Please take a look at my earlier responses in this ticket or to my answer on #32 |
When I try Listing 4-8 on page 52
COPY us_counties_2010
TO 'C:\us_counties_export.txt'
WITH (FORMAT CSV, HEADER, DELIMITER '|')
I get the following error message:
ERROR: could not open file "C:\us_counties_export.txt" for writing: Permission denied
HINT: COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy. SQL state: 42501
I have no idea how to rectify this situation.
The text was updated successfully, but these errors were encountered: