Live data from Hacker News

Mastering PostgreSQL in Application Development

masteringpostgresql.com

51–60 of 101 posts

Re: Mastering PostgreSQL in Application Development

#52
post #45

I bought the dead tree edition. The FAQ page says that I should send author an email with the receipt to get the pdf and mobi version; however, I can't find the author's email address anywhere. Any clues?

The e-mail address is easily found in the paperback version, and I just added it to the FAQ as well, thanks for reporting the bug!

Re: Mastering PostgreSQL in Application Development

#53
post #41

I've been wondering for a while about the practicalities of using postgres as a replacement or near-replacement for a traditional backend - does anyone have any opinions on how far it's wise to go with this (postgres-only? authentication? direct connections from the client?) and/or how feasible that kind of thing is?

Not sure that I would do authentication directly in PG (although it has many different methods [0]), I think it's still doable. You could move whole oAuth to PG through PL/SQL (maybe there is an extension for it?). I would also encourage to introduce a proxy in between (e.g. pgbouncer [1]) to help you to handle connections and deal with the authentication. We're using PG as "the brain" of our service since 2014 and i…

> Not sure that I would do authentication directly in PG

I agree. But I am thinking about making a database role for each user. The user becomes that role after signing into the front end, like Apache.

   db.exec('set role to $1', req.remote_user);
Apache 2.4's form-based authentication makes this attractive.

> The biggest downside is that there are no tools to help to debug or measure the performance of the code you wrote.

Isn't there the explain command (https://www.postgresql.org/docs/current/static/using-explain...) and the \timing option for the command-line client, psql (https://www.postgresql.org/docs/10/static/app-psql.html)?

Re: Mastering PostgreSQL in Application Development

#54

Look interesting but I'm not crazy about the fact that to get the source + data, I have to get the $90 version.

True and it's unclear how usable cheaper options will be without those files. It's pretty much a de facto standard that source code going along a technical book is available for free. This is too bad because I would have purchased it instantly otherwise.

Re: Mastering PostgreSQL in Application Development

#55
post #41

Earlier quoted context omitted.

Not sure that I would do authentication directly in PG (although it has many different methods [0]), I think it's still doable. You could move whole oAuth to PG through PL/SQL (maybe there is an extension for it?). I would also encourage to introduce a proxy in between (e.g. pgbouncer [1]) to help you to handle connections and deal with the authentication. We're using PG as "the brain" of our service since 2014 and i…

> Not sure that I would do authentication directly in PG I agree. But I am thinking about making a database role for each user. The user becomes that role after signing into the front end, like Apache. db.exec('set role to $1', req.remote_user); Apache 2.4's form-based authentication makes this attractive. > The biggest downside is that there are no tools to help to debug or measure the performance of the code you wr…

> I agree. But I am thinking about making a database role for each user. The user becomes that role after signing into the front end, like Apache.

I figured. If you isolate the data well enough, it could work. I'm always paranoid when it comes to DB.

> Isn't there the explain command and the \timing option for the command-line client, psql? Yes, there is. This however doesn't help you with triggers and UDF, which is how you usually create the logic in the DB.

Re: Mastering PostgreSQL in Application Development

#57
post #23

Earlier quoted context omitted.

Email for updates being a foot in the door for further communications is pro forma and legally regulated. I think you're unnecessarily suspicious.

Even if it isn't nefarious, it's often unwanted. I usually turn around if I have to provide my email to see some sort of whitepaper or sample because it means I will have to later unsubscribe from whatever email list I was put on and hope they don't share the list with others (which happens, often).

If only there was an email service that let you create multiple email addresses for free! Or better yet one that let you create an email address that only exists for 10 minutes. A 10 minute mail service if you will.

Re: Mastering PostgreSQL in Application Development

#58
post #11
post #6

@tapoueh what level is this targeted at? It looks like it starts from a relatively basic level and covers pg usage fairly broadly. Would you recommend it to advanced users, or does it not go too deep into advanced usage?

The book definitely go into advanced usage. If you're already fluent in LATERAL joins, GROUPING SETS, Arrays, and JSON techniques, you might get bored to some degree. Every single chapter has some beginner, then intermediate, then advanced topics covered, so I think everybody should have some of the right content, really. I tried and paid attention!

[deleted]

Re: Mastering PostgreSQL in Application Development

#59

Look interesting but I'm not crazy about the fact that to get the source + data, I have to get the $90 version.

True and it's unclear how usable cheaper options will be without those files. It's pretty much a de facto standard that source code going along a technical book is available for free. This is too bad because I would have purchased it instantly otherwise.

The book contains references for every data source it uses, all of them are available as Open Data. So you can load all the data, and copy/paste all the SQL queries with just the Book Edition.

The Full Edition isn't so much about the code contained in the book (SQL queries) as it is about having the very database used in the book handy to replay the queries.

I understand that the Full Edition doesn't make the same value for everyone, and it's fine. That's why it's not the only option. Given how many are sold compared to the other options, I'm confident it still is a solid option though.

Re: Mastering PostgreSQL in Application Development

#60
I like the idea of it targeting developers but aren't most developers going to end up using an ORM in the end?

For example SQLALchemy in Python and ActiveRecord in Rails.

Is the book a ton of SQL examples or general theory?

Most of my day to day database activities as a web developer are creating good indexes, data modeling and setting up queries with an ORM.

Post reply on HN