PG Casts – Postgres Screencasts
pgcasts.com
pgcasts.com
Most web frameworks focus on routing/validations/sessions and new programmers like me tend to write the data storage logic around the library, even though SQL is so much nicer and intuitive for this sort of thing.
We'd love feedback on the screencasts and suggestions on topics that you'd like to see covered!
request : can you do some screencasts on window functions ?
CHARACTER VARYING is the basic type of string, and can be given with a maximum character length. If no length is given, the max value is assumed.
CHARACTER is a padded string - all strings are padded to the specified length with spaces. If no length is given, the length 1 is assumed.
TEXT is an alias for a CHARACTER VARYING without a length parameter (max length).
Actually all string types are handled the same internally, and there's no performance reason to use CHARACTER instead of CHARACTER VARYING. In fact it may hurt performance since the padding increases the data size. Using length constraints also carries a slight performance hit during writes as the constraint gets checked.
https://www.postgresql.org/docs/9.5/static/datatype-characte...
Best practices around those tasks would really be helpful.
https://vladmihalcea.com/2014/06/23/the-hilo-algorithm/
Basically, it optimizes for lots of insert operations by using a composite primary key, one of which is a SERIAL assigned by the server, and the other is a value arbitrarily assigned by the client. This allows a client to assign and use many new unique keys without asking the server for a new value for every individual row.
Recursive Queries (+ generating JSON from them)
Advanced Index Types
(Ab-)using arrays & custom types (contrast with JSON(B) for everything)
It covers the basics of setting up Postgres as well as other things.