Skip to content
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: COPY us_counties_2010 Permission Denied Question" #32

Open
gobinaryn opened this issue Oct 10, 2021 · 2 comments
Open

"Chapter 4: COPY us_counties_2010 Permission Denied Question" #32

gobinaryn opened this issue Oct 10, 2021 · 2 comments
Assignees

Comments

@gobinaryn
Copy link

Having trouble with data, code, or exercises in Practical SQL? I'm glad to help. Please answer these questions, and I'll typically reply within one to two business days.

Please include the chapter number in your issue title. For example: "Chapter 13: Regular Expression Question"

General

Please answer all of these as they're essential for troubleshooting.

What's your operating system (e.g. Windows 10, macOS Catalina, Ubuntu, etc.)?
WINDOWS 10

Did you install PostgreSQL and pgAdmin according to the steps on page xxviii of the book's Introduction? If not, please describe your installation.
Yes and everything was smooth sailing!

Which versions of PostgreSQL and pgAdmin 4 are you using? If you aren't sure, for PostgreSQL run the SQL command SELECT version(); and for pgAdmin 4, navigate to "About pgAdmin 4" under the "Help" menu.
Version 14

Did you download the book's code examples and data from GitHub using the directions on page xxvii of the Introduction? If not, please describe how you loaded the material on your computer.
Yes :-)

Issue or Question

Chapter, page and code listing number:
Chapter 4, pages 44-45

Describe the issue or your question:
How do I fix the permission denied error for copying over a CSV?
Note: I could not write to a CSV either in Chapter 3.

Please paste the code and error message here. It's OK to alter identifying info such as a folder name
ERROR: could not open file "C:\Users\xxxxxx\Desktop\Practical SQL\us_counties_2010.csv" for reading: Permission denied
HINT: COPY FROM instructs the PostgreSQL server process to read a file. You may want a client-side facility such as psql's \copy.
SQL state: 42501

@anthonydb
Copy link
Owner

Hi, @gobinaryn,

On page xxvii of the Introduction (Practical SQL 1st edition), in the section "Using the Book's Code Examples," there's the following note:

After downloading data, Windows users might need to provide permission for the 
database to read files. To do so, right-click the folder containing the code and data, 
select Properties, and click the Security tab. Click Edit, then Add. Type the name 
Everyone into the object names box and click OK. Highlight Everyone in the user 
list, select all boxes under Allow, and then click Apply and OK.

Would you please check that note, make sure you've enabled those permissions, and report back? Thanks!

@gobinaryn
Copy link
Author

Hi, yes that did work! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants