diff --git a/README.md b/README.md index 18d8140..e22e005 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_555 TILs and counting..._ +_556 TILs and counting..._ --- @@ -263,6 +263,7 @@ _555 TILs and counting..._ - [Assumed Radius Of The Earth](postgres/assumed-radius-of-the-earth.md) - [Auto Expanded Display](postgres/auto-expanded-display.md) - [Between Symmetric](postgres/between-symmetric.md) +- [Capitalize All The Words](postgres/capitalize-all-the-words.md) - [Change The Current Directory For psql](postgres/change-the-current-directory-for-psql.md) - [Checking Inequality](postgres/checking-inequality.md) - [Checking The Type Of A Value](postgres/checking-the-type-of-a-value.md) diff --git a/postgres/capitalize-all-the-words.md b/postgres/capitalize-all-the-words.md new file mode 100644 index 0000000..cbff618 --- /dev/null +++ b/postgres/capitalize-all-the-words.md @@ -0,0 +1,23 @@ +# Capitalize All The Words + +PostgreSQL provides the string function `initcap()` as a way of capitalizing +all words. In the process, it cleans up the casing of the remaining parts of +the words. + +Here are some example of how it works. + +```sql +> select initcap('hello, world'); + initcap +-------------- + Hello, World + +> select initcap('HELLO, WORLD'); + initcap +-------------- + Hello, World +``` + +See the [String Functions and Operators +docs](https://www.postgresql.org/docs/current/static/functions-string.html) +for more details.