I'm trying to create a table into my PostGIS 2.3
CREATE TABLE destinations (
id serial PRIMARY KEY,
sector integer REFERENCES sectors(id),
name varchar(64) NOT NULL,
location geography(POINT, 25831) NOT NULL,
authcode varchar(16) NOT NULL
);
I specify the SRS ESPG:25831 that I'm using to the location field, but I get this error:
ERROR: Only lon/lat coordinate systems are supported in geography.
LINE 6: location geography(POINT,25831) NOT NULL,
I've checked the spatial_ref_sys table and 25831 is there. I also have enabled the PostGIS extension. In fact, my query works if I remove the SRS:
location geography(POINT) NOT NULL,
Any idea of what am I doing wrong?