News for hackers. Stuff that matters.
Re:PostgreSQL Exercises by mattmanser on Thursday December 12, 2013 @06:18AM (#6893874)
How can you retrieve all the information from the facilities table?

SELECT * FROM Facilities

ERROR: relation "facilities" does not exist Position: 15

Query was: SELECT * FROM Facilities

Useful.

It looks great, it's almost there but you've got to approach these things from the point of view of a novice.

Re:PostgreSQL Exercises by AlisdairO on Thursday December 12, 2013 @07:06AM (#6894014)
Thanks for the feedback - I've modified the page so a refresh should show that the question specifies the 'cd.facilities' table. Hopefully soon I should be able to implement a mini tutorial that walks you through the page the first time you see it, and points out that the help button will show you the db schema - I'm aware it's not too obvious as things stand.
Re:PostgreSQL Exercises by cones688 on Thursday December 12, 2013 @06:25AM (#6893901)
In getting started it does give the table names... which are all prefixed cd.tablename, it is an educational tool so one would expect one to read the getting started pages first.
Re:PostgreSQL Exercises by mattmanser on Thursday December 12, 2013 @06:33AM (#6893933)
Would one? Do you read your manuals perchance?

There are different types of learner, some learn by poking stuff with a stick rather than meticulously reading everything.

I have no idea about postgre as I know SQL Server & MySQL, I was actually having a quick go to see if my knowledge easily translated.

But schemas are a YAGNI 99% of the time feature in those.

Re:PostgreSQL Exercises by louthy on Thursday December 12, 2013 @06:58AM (#6893992)
I have to agree, my experience was exactly the same.
Re:PostgreSQL Exercises by asdasf on Thursday December 12, 2013 @10:42AM (#6894993)
>But schemas are a YAGNI 99% of the time feature in those.

What? I literally have only ever written one web app that didn't use multiple schemas, and that was a simple blog. I think you are confusing "I don't bother to use X" with "X isn't very useful".

Re:PostgreSQL Exercises by mattmanser on Thursday December 12, 2013 @05:08PM (#6897633)
Most people don't bother with them, it's like juggling namespaces, mainly a complete waste of keystrokes.

There's little to no chance of collisions but you have to use them constantly, which is annoying. Few benefits, lots of downsides.

Re:PostgreSQL Exercises by AlisdairO on Friday December 13, 2013 @03:22PM (#6902688)
I don't think it's just about collisions, in fairness. There's also the aspect of managing user permissions by schema, searching for tables, and so on.

Obviously this only becomes super-useful in pretty sizeable projects, but I tend to consider using schemas a good habit to be in.

Re:PostgreSQL Exercises by asdasf on Monday December 16, 2013 @10:35AM (#6915313)
Have you ever tried using them before? You can set your search path, you don't need to type out schema.table. Your objects are already in a schema anyways, it isn't like you type out public.table all the time. What are these "lots of downsides" you leave unspecified? And how do they outweigh the benefits of grouping database objects together for both namespacing and permissions purposes?
Re:PostgreSQL Exercises by jfarmer on Thursday December 12, 2013 @06:36PM (#6898046)
> it is an educational tool so one would expect one to read the getting started pages first

This is the opposite of how it should be. You'd expect learners to be less likely to read a "getting started" page than an expert.

For example, saying to a beginner, "Oh, the tables are all prefixed with cd.tablename" will likely result in a look of confusion because the beginner didn't understand any of the words you used or the way in which you combined them. Is that period special, for example? You said prefix, so if I type "cd.tablenamefacilities" will that work? What are tables and how do I know what their "name" is? Why is the error message talking about "relations?" And so on.