# Learning postgresql



## Alain De Vos (Oct 2, 2021)

I want to learn postgresql , i.e. administrating & programming.
But i find many books dissatisfying.
If you a good book or online resource youtube or website, feel free to share.
PS1: postgresql is powerfull as it knows alot of json and you can do many things done by nosql databases.
PS2:Should i tune /etc/sysctl.conf for postresql ?


----------



## obsigna (Oct 2, 2021)

My first stop for any doubts with PostgreSQL is its manual. Perhaps you didn't consider this because of the name "Manual", as a matter of fact it is "The PostgreSQL Book" written by the PostgreSQL developer group. For offline reading, I prefer the PDF version, but there is a online version too. The book is very well organized by chapters, and my PDF reader honours the Table of Contents facility and it allows me to enter any keywords and phrases in a search box. The A4-PDF of PostgreSQL 14 got 2785 pages, and it is not only the mere quantity which makes this outstanding, but also the quality of the presentation is simply perfect.

Offline PDF versions:




__





						PostgreSQL: Documentation
					






					www.postgresql.org
				




Online version:








						PostgreSQL 14.3 Documentation
					

PostgreSQL 14.3 Documentation The PostgreSQL Global Development Group Copyright © 1996–2022 The PostgreSQL Global Development Group Legal Notice Table of …




					www.postgresql.org
				




This is one of the best written "Manuals" of computer software, and whether open or closed source, it is hard to find a better one.


----------



## Jose (Oct 2, 2021)

I have also found the Postgresql documentation to be excellent.


----------



## Sevendogsbsd (Oct 2, 2021)

In addition to this, if you are designing a database, make sure you understand the concept of data normalization, within reason, because otherwise you will run into data retrieval or storage issues later. For small, single databases it’s probably not much of an issue but normalization is a good concept to understand anyway. https://en.wikipedia.org/wiki/Database_normalization


----------



## Alain De Vos (Oct 2, 2021)

Two sidenotes sevendogbsd. Sometime you can normalize more than is necessary for a given the problem.  But how do we know ?
And sometimes it is better to think in function of objects. For the latter you simply add an integer primary key value which increases each time. There are even different schools if you should do this or not.
Some sql books don't even explain a join nicely.


----------



## Sevendogsbsd (Oct 2, 2021)

Agree, which is why I said “within reason”. I just didn’t know if you understood the concept but it looks like you do.


----------



## Jose (Oct 2, 2021)

Alain De Vos said:


> And sometimes it is better to think in function of objects.


Please don't mix relational concepts with object-oriented thinking. Much blood has been spilled on that battlefield.




__





						Object–relational impedance mismatch - Wikipedia
					






					en.wikipedia.org
				




I love them both, but they don't go together.



Alain De Vos said:


> For the latter you simply add an integer primary key value which increases each time.


Are you referring to sequences? They have their uses, but not every table should have a surrogate key. Sometimes your data will have a nice, invariant natural key, like an email address. Please use it.


----------



## drhowarddrfine (Oct 2, 2021)

+1 obsigna One of the best manuals I've ever read and had to look through to find answers.


----------



## Alain De Vos (Oct 2, 2021)

For me it's a dead link drhowarddrfine.


----------

