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

Inclusion of COPY statements in DDL files prevents readers from simply loading them. #1

Open
jberkus opened this issue Jun 13, 2017 · 3 comments

Comments

@jberkus
Copy link

jberkus commented Jun 13, 2017

Hey, your tech reviewer here.

Example: https://github.com/anthonydb/practical-sql/blob/master/Chapter_08/Chapter_08.sql

The COPY statements are interspersed with table definition statements. The problem with this is that the COPY statements are going to be specific the the reader's OS and where they saved the files. This prevents the reader from simply running the file using PSQL or pgAdmin.

I suggest instead putting the example COPY statements in there, commented out.

@anthonydb
Copy link
Owner

Hey, Josh! 👋

So, you're saying to comment out all the COPY statements in these .sql files so that a reader could create all the tables at once by running the whole script? In that case, do you recommend separating the CREATE TABLE statements from the SELECT statement listings also in the file?

@jberkus
Copy link
Author

jberkus commented Jun 14, 2017

Yeah, I was just realizing that all of the select queries are in one file, which really doesn't work with the "run the file" idea.

Chapter 8 is a little different just because those "create table" statements are so large that they're kind of annoying to copy & paste, or to select+execute in pgAdmin. Specifically for chapter 8, it might do to have a separate file for create table just so that the reader can simply execute those, and all the other statements in another file.

@anthonydb
Copy link
Owner

OK, that sounds like a good idea. I'll switch that up when I revise the chapter based on your additional comments. Thanks!

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

No branches or pull requests

2 participants