Thread: [GENERAL] Book or other resource on Postgres-local code?

[GENERAL] Book or other resource on Postgres-local code?

From
Guyren Howe
Date:
As an aside from my last question about my LYDB effort:


I would like to find a book or other resource about SQL server-side programming (stored procedures etc) best practices in general and for Postgres in particular.

Seems like a thing that should exist. I can find a variety of blog posts, mostly about Oracle and MS SQL Server, but nothing that appears particularly canonical or “classic”.

Is there such a resource?

Re: [GENERAL] Book or other resource on Postgres-local code?

From
Rich Shepard
Date:
On Thu, 29 Dec 2016, Guyren Howe wrote:

> I would like to find a book or other resource about SQL server-side
> programming (stored procedures etc) best practices in general and for
> Postgres in particular.

   Start here:
<http://www.postgresqltutorial.com/postgresql-stored-procedures/>

Rich


Re: [GENERAL] Book or other resource on Postgres-local code?

From
"Charles Clavadetscher"
Date:

Hi

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Guyren Howe
Sent: Donnerstag, 29. Dezember 2016 23:32
To: pgsql-general <pgsql-general@postgresql.org>
Subject: [GENERAL] Book or other resource on Postgres-local code?

 

As an aside from my last question about my LYDB effort:

 

 

I would like to find a book or other resource about SQL server-side programming (stored procedures etc) best practices in general and for Postgres in particular.

 

I found this book quite helpful (I have the first edition, but I assume that the second is even better):

 

https://www.packtpub.com/big-data-and-business-intelligence/postgresql-server-programming-second-edition/?utm_source=PoD&utm_medium=referral&utm_campaign=1783980583

 

Regards

Charles

 

 

Seems like a thing that should exist. I can find a variety of blog posts, mostly about Oracle and MS SQL Server, but nothing that appears particularly canonical or “classic”.

 

Is there such a resource?

Re: [GENERAL] Book or other resource on Postgres-local code?

From
"Regina Obe"
Date:
> As an aside from my last question about my LYDB effort:

> https://medium.com/@gisborne/love-your-database-lydb-23c69f480a1d#.4jngp2rcb

> I would like to find a book or other resource about SQL server-side programming (stored procedures etc) best
practicesin general and for Postgres in particular. 

> I found this book quite helpful (I have the first edition, but I assume that the second is even better):

>
https://www.packtpub.com/big-data-and-business-intelligence/postgresql-server-programming-second-edition/?utm_source=PoD&utm_medium=referral&utm_campaign=1783980583

> Regards
> Charles


> Seems like a thing that should exist. I can find a variety of blog posts, mostly about Oracle and MS SQL Server, but
nothingthat appears particularly canonical or “classic”. 

> Is there such a resource?

Shameless plug

Have you checked out our book?  The 2nd edition covered PostgreSQL 9.2 - 9.4.
http://shop.oreilly.com/product/0636920052715.do

We are working on the 3rd edition which is a bit fatter (probably will be about 50 pages fatter when we are done) than
the2nd edition.   

http://shop.oreilly.com/product/0636920052715.do

The 3rd focuses on PostgreSQL 9.5-9.6 (and is in prerelease sale at moment).  By the time of release, we'll probably
havesome PostgreSQL 10 content in there as well. 

It covers fancy SQL constructs and data types (both ANSI ones and ones unique to PostgreSQL), general administration,
andwriting stored functions with SQL, PLPGSQL and PL/V8. 

In the 3rd we are adding an additional PL/V8 example how to build a window function in PL/V8 (aka PL/JavaScript)

Thanks,
Regina




Re: [GENERAL] Book or other resource on Postgres-local code?

From
Guyren Howe
Date:
> On Dec 29, 2016, at 23:01 , Regina Obe <lr@pcorp.us> wrote:
>
>
>> As an aside from my last question about my LYDB effort:
>
>> https://medium.com/@gisborne/love-your-database-lydb-23c69f480a1d#.4jngp2rcb
>
>> I would like to find a book or other resource about SQL server-side programming (stored procedures etc) best
practicesin general and for Postgres in particular. 
>
> Shameless plug
>
> Have you checked out our book?  The 2nd edition covered PostgreSQL 9.2 - 9.4.
> http://shop.oreilly.com/product/0636920052715.do
>
> We are working on the 3rd edition which is a bit fatter (probably will be about 50 pages fatter when we are done)
thanthe 2nd edition.   
>
> http://shop.oreilly.com/product/0636920052715.do
>
> The 3rd focuses on PostgreSQL 9.5-9.6 (and is in prerelease sale at moment).  By the time of release, we'll probably
havesome PostgreSQL 10 content in there as well. 
>
> It covers fancy SQL constructs and data types (both ANSI ones and ones unique to PostgreSQL), general administration,
andwriting stored functions with SQL, PLPGSQL and PL/V8. 
>
> In the 3rd we are adding an additional PL/V8 example how to build a window function in PL/V8 (aka PL/JavaScript)

I’m sure the book is great. But it looks like much of the material I can find about Postgres: how to write a function,
howto write a query, etc. 

What I’m more looking for is “System Design with Postgres”: *when* to write a function, *when* to use a stored
procedureover a client-side function. 

Re: [GENERAL] Book or other resource on Postgres-local code?

From
Pavel Stehule
Date:


2016-12-30 8:04 GMT+01:00 Guyren Howe <guyren@gmail.com>:

> On Dec 29, 2016, at 23:01 , Regina Obe <lr@pcorp.us> wrote:
>
>
>> As an aside from my last question about my LYDB effort:
>
>> https://medium.com/@gisborne/love-your-database-lydb-23c69f480a1d#.4jngp2rcb
>
>> I would like to find a book or other resource about SQL server-side programming (stored procedures etc) best practices in general and for Postgres in particular.
>
> Shameless plug
>
> Have you checked out our book?  The 2nd edition covered PostgreSQL 9.2 - 9.4.
> http://shop.oreilly.com/product/0636920052715.do
>
> We are working on the 3rd edition which is a bit fatter (probably will be about 50 pages fatter when we are done) than the 2nd edition.
>
> http://shop.oreilly.com/product/0636920052715.do
>
> The 3rd focuses on PostgreSQL 9.5-9.6 (and is in prerelease sale at moment).  By the time of release, we'll probably have some PostgreSQL 10 content in there as well.
>
> It covers fancy SQL constructs and data types (both ANSI ones and ones unique to PostgreSQL), general administration, and writing stored functions with SQL, PLPGSQL and PL/V8.
>
> In the 3rd we are adding an additional PL/V8 example how to build a window function in PL/V8 (aka PL/JavaScript)

I’m sure the book is great. But it looks like much of the material I can find about Postgres: how to write a function, how to write a query, etc.

What I’m more looking for is “System Design with Postgres”: *when* to write a function, *when* to use a stored procedure over a client-side function.

Lot of Oracle's books related to this topic is valid for PostgreSQL too. The design of stored procedures in PostgreSQL is conceptually similar to Oracle. 

The theme "stored procedures" is strongly controversial -  from "stored procedures are evil" to "do all in procedures". 

I like the strategy - what you can do easy in database, do it there - the client should to get a results. But don't do communication server from database. PostgreSQL is ACID, stored procedures are ACID. Outer world is not ACID - and interface ACID/NOACID is better to implement outside database.

Regards

Pavel



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Book or other resource on Postgres-local code?

From
Melvin Davidson
Date:


On Fri, Dec 30, 2016 at 2:50 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:


2016-12-30 8:04 GMT+01:00 Guyren Howe <guyren@gmail.com>:

> On Dec 29, 2016, at 23:01 , Regina Obe <lr@pcorp.us> wrote:
>
>
>> As an aside from my last question about my LYDB effort:
>
>> https://medium.com/@gisborne/love-your-database-lydb-23c69f480a1d#.4jngp2rcb
>
>> I would like to find a book or other resource about SQL server-side programming (stored procedures etc) best practices in general and for Postgres in particular.
>
> Shameless plug
>
> Have you checked out our book?  The 2nd edition covered PostgreSQL 9.2 - 9.4.
> http://shop.oreilly.com/product/0636920052715.do
>
> We are working on the 3rd edition which is a bit fatter (probably will be about 50 pages fatter when we are done) than the 2nd edition.
>
> http://shop.oreilly.com/product/0636920052715.do
>
> The 3rd focuses on PostgreSQL 9.5-9.6 (and is in prerelease sale at moment).  By the time of release, we'll probably have some PostgreSQL 10 content in there as well.
>
> It covers fancy SQL constructs and data types (both ANSI ones and ones unique to PostgreSQL), general administration, and writing stored functions with SQL, PLPGSQL and PL/V8.
>
> In the 3rd we are adding an additional PL/V8 example how to build a window function in PL/V8 (aka PL/JavaScript)

I’m sure the book is great. But it looks like much of the material I can find about Postgres: how to write a function, how to write a query, etc.

What I’m more looking for is “System Design with Postgres”: *when* to write a function, *when* to use a stored procedure over a client-side function.

Lot of Oracle's books related to this topic is valid for PostgreSQL too. The design of stored procedures in PostgreSQL is conceptually similar to Oracle. 

The theme "stored procedures" is strongly controversial -  from "stored procedures are evil" to "do all in procedures". 

I like the strategy - what you can do easy in database, do it there - the client should to get a results. But don't do communication server from database. PostgreSQL is ACID, stored procedures are ACID. Outer world is not ACID - and interface ACID/NOACID is better to implement outside database.

Regards

Pavel



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

> would like to find a book or other resource about SQL server-side programming (stored procedures etc) best practices in general and for Postgres in particular.

I'll start off with Enumerated types are evil. You are much better off with Foriegn Key Constraints.
That being said, there are four excellent books that I always recommend to my clients:

PostgreSQL Development Essentials:
https://www.amazon.com/PostgreSQL-Development-Essentials-Manpreet-Kaur/dp/1783989009/ref=sr_1_2?s=books&ie=UTF8&qid=1483111853&sr=1-2&keywords=PostgreSQL#reader_B01LFAN8B6

PostgreSQL 9 Administration Cookbook
https://www.packtpub.com/big-data-and-business-intelligence/postgresql-9-administration-cookbook-second-edition

PostgreSQL Server Programming
https://www.packtpub.com/big-data-and-business-intelligence/postgresql-server-programming-second-edition

PostgreSQL 9.0 High Performance
https://www.packtpub.com/big-data-and-business-intelligence/postgresql-90-high-performance

In addition, I've attached my own controversial PostgreSQL Developer Best Practices



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

Attachment