diff --git a/README.md b/README.md index 55d5423..79c532e 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Defining Arrays](postgres/defining-arrays.md) - [Edit Existing Functions](postgres/edit-existing-functions.md) - [Extracting Nested JSON Data](postgres/extracting-nested-json-data.md) +- [Find The Data Directory](postgres/find-the-data-directory.md) - [Fizzbuzz With Common Table Expressions](postgres/fizzbuzz-with-common-table-expressions.md) - [Generate A UUID](postgres/generate-a-uuid.md) - [Generate Series Of Numbers](postgres/generate-series-of-numbers.md) diff --git a/postgres/find-the-data-directory.md b/postgres/find-the-data-directory.md new file mode 100644 index 0000000..a206ada --- /dev/null +++ b/postgres/find-the-data-directory.md @@ -0,0 +1,14 @@ +# Find The Data Directory + +Where does postgres store all of the data for a database cluster? Well, in +its data directory. Where exactly that data directory is can depend on how +the database cluster was setup. Postgres can tell you right where to look, +though. Within `psql`, run + +```sql +> show data_directory +``` + +Postgres will output the absolute path of the data directory. + +[source](http://dba.stackexchange.com/questions/1350/how-do-i-find-postgresqls-data-directory)