1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 17:18:02 +00:00

Add Assumed Radius Of The Earth as a postgres til

This commit is contained in:
jbranchaud
2016-05-25 21:28:05 -05:00
parent 068651582a
commit 0c9602e9f3
2 changed files with 20 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
warrant a full blog post. These are mostly things I learn by pairing with warrant a full blog post. These are mostly things I learn by pairing with
smart people at [Hashrocket](http://hashrocket.com/). smart people at [Hashrocket](http://hashrocket.com/).
_422 TILs and counting..._ _423 TILs and counting..._
--- ---
@@ -174,6 +174,7 @@ _422 TILs and counting..._
- [Add ON DELETE CASCADE To Foreign Key Constraint](postgres/add-on-delete-cascade-to-foreign-key-constraint.md) - [Add ON DELETE CASCADE To Foreign Key Constraint](postgres/add-on-delete-cascade-to-foreign-key-constraint.md)
- [Adding Composite Uniqueness Constraints](postgres/adding-composite-uniqueness-constraints.md) - [Adding Composite Uniqueness Constraints](postgres/adding-composite-uniqueness-constraints.md)
- [Aggregate A Column Into An Array](postgres/aggregate-a-column-into-an-array.md) - [Aggregate A Column Into An Array](postgres/aggregate-a-column-into-an-array.md)
- [Assumed Radius Of The Earth](postgres/assumed-radius-of-the-earth.md)
- [Auto Expanded Display](postgres/auto-expanded-display.md) - [Auto Expanded Display](postgres/auto-expanded-display.md)
- [Change The Current Directory For psql](postgres/change-the-current-directory-for-psql.md) - [Change The Current Directory For psql](postgres/change-the-current-directory-for-psql.md)
- [Checking The Type Of A Value](postgres/checking-the-type-of-a-value.md) - [Checking The Type Of A Value](postgres/checking-the-type-of-a-value.md)

View File

@@ -0,0 +1,18 @@
# Assumed Radius Of The Earth
Using the
[`earthdistance`](https://www.postgresql.org/docs/8.3/static/earthdistance.html)
module, we can get the assumed radius of the earth (in meters).
```sql
> create extension cube;
CREATE EXTENSION
> create extension earthdistance;
CREATE EXTENSION
> select earth();
earth
---------
6378168
```