mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Remove support for version-0 calling conventions.
The V0 convention is failure prone because we've so far assumed that a function is V0 if PG_FUNCTION_INFO_V1 is missing, leading to crashes if a function was coded against the V1 interface. V0 doesn't allow proper NULL, SRF and toast handling. V0 doesn't offer features that V1 doesn't. Thus remove V0 support and obsolete fmgr README contents relating to it. Author: Andres Freund, with contributions by Peter Eisentraut & Craig Ringer Reviewed-By: Peter Eisentraut, Craig Ringer Discussion: https://postgr.es/m/20161208213441.k3mbno4twhg2qf7g@alap3.anarazel.de
This commit is contained in:
@ -88,16 +88,8 @@ geo_distance_internal(Point *pt1, Point *pt2)
|
||||
*
|
||||
* returns: float8
|
||||
* distance between the points in miles on earth's surface
|
||||
*
|
||||
* If float8 is passed-by-value, the oldstyle version-0 calling convention
|
||||
* is unportable, so we use version-1. However, if it's passed-by-reference,
|
||||
* continue to use oldstyle. This is just because we'd like earthdistance
|
||||
* to serve as a canary for any unintentional breakage of version-0 functions
|
||||
* with float8 results.
|
||||
******************************************************/
|
||||
|
||||
#ifdef USE_FLOAT8_BYVAL
|
||||
|
||||
PG_FUNCTION_INFO_V1(geo_distance);
|
||||
|
||||
Datum
|
||||
@ -110,17 +102,3 @@ geo_distance(PG_FUNCTION_ARGS)
|
||||
result = geo_distance_internal(pt1, pt2);
|
||||
PG_RETURN_FLOAT8(result);
|
||||
}
|
||||
#else /* !USE_FLOAT8_BYVAL */
|
||||
|
||||
double *geo_distance(Point *pt1, Point *pt2);
|
||||
|
||||
double *
|
||||
geo_distance(Point *pt1, Point *pt2)
|
||||
{
|
||||
double *resultp = palloc(sizeof(double));
|
||||
|
||||
*resultp = geo_distance_internal(pt1, pt2);
|
||||
return resultp;
|
||||
}
|
||||
|
||||
#endif /* USE_FLOAT8_BYVAL */
|
||||
|
Reference in New Issue
Block a user