It's a little known fact that the PostGIS geography type since PostGIS 2.2 (well was introduced in 2.1 I think but had a bug in it until 2.1.4 or so), supports any spheroidal spatial reference system that measures in degrees. When an srid is not specified, it defaults to using 4326, Earth WGS 84 long lat.

Here is an example to demonstrate. Suppose you were doing research about Mars and all your observations on Mars are in longitude/latitude of Mars. You would add an entry such as this one to your spatial_ref_sys table, using this code:

INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 949900, 'iau2000', 49900, '+proj=longlat +a=3396190 +b=3376200 +no_defs ', 'GEOGCS["Mars 2000",DATUM["D_Mars_2000", SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.89444722361179]], PRIMEM["Greenwich",0],UNIT["Decimal_Degree",0.0174532925199433]]');

Given that Mars is a smaller planet than earth, you would expect any distance between two locations on the planet to be lower than same on Earth. We'll test this out.

SELECT ST_Distance(ST_GeogFromText('SRID=949900;POINT(1 2)'), ST_GeogFromText('SRID=949900;POINT(1 1)'));

Gives answer:

st_distance --------------- 58579.7013291 (1 row)

Now doing the same with our earth using WGS 84 long/lat but same point locations

SELECT ST_Distance(ST_GeogFromText('SRID=4326;POINT(1 2)'), ST_GeogFromText('SRID=4326;POINT(1 1)'));

Gives answer:

st_distance ----------------- 110575.06481434 (1 row)

As expected the distance between longitude/latitude of 1,2 to 1,1 on the surface of earth is much longer than it is on Mars.