We'd love feedback on the screencasts and suggestions on topics that you'd like to see covered!
We'd love feedback on the screencasts and suggestions on topics that you'd like to see covered!
Best practices around those tasks would really be helpful.
request : can you do some screencasts on window functions ?
Recursive Queries (+ generating JSON from them)
Advanced Index Types
(Ab-)using arrays & custom types (contrast with JSON(B) for everything)
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...
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.