Skip to content

Commit e679906

Browse files
authored
Merge pull request #25 from vitcpp/7-parallel-safe
[ISSUE-7] Added PARALLEL SAFE mark to pgSphere functions
2 parents 472b209 + 08edcd6 commit e679906

21 files changed

+709
-369
lines changed

Diff for: Makefile

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PGSPHERE_VERSION = 1.2.1
1+
PGSPHERE_VERSION = 1.2.2
22

33
# the base dir name may be changed depending on git clone command
44
SRC_DIR = $(shell basename $(shell pwd))
@@ -19,7 +19,8 @@ DATA_built = $(RELEASE_SQL) \
1919
pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql \
2020
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql \
2121
pg_sphere--1.1.5beta4gavo--1.2.0.sql \
22-
pg_sphere--1.2.0--1.2.1.sql
22+
pg_sphere--1.2.0--1.2.1.sql \
23+
pg_sphere--1.2.1--1.2.2.sql
2324

2425
DOCS = README.pg_sphere COPYRIGHT.pg_sphere
2526
REGRESS = init tables points euler circle line ellipse poly path box index \
@@ -82,7 +83,6 @@ healpix_bare/healpix_bare.o : healpix_bare/healpix_bare.c
8283
# experimental for spoint3
8384
pg_version := $(word 2,$(shell $(PG_CONFIG) --version))
8485
pg_version_9_5_plus = $(if $(filter-out 9.1% 9.2% 9.3% 9.4%,$(pg_version)),y,n)
85-
has_parallel = $(if $(filter-out 9.1% 9.2% 9.3% 9.4% 9.5%,$(pg_version)),y,n)
8686
has_explain_summary = $(if $(filter-out 9.%,$(pg_version)),y,n)
8787
#
8888

@@ -115,9 +115,6 @@ pg_sphere.test.sql: $(RELEASE_SQL) $(shlib)
115115

116116
$(RELEASE_SQL): $(addsuffix .in, $(RELEASE_SQL) $(PGS_SQL))
117117
cat $^ > $@
118-
ifeq ($(has_parallel), n)
119-
sed -i -e '/PARALLEL/d' $@ # version $(pg_version) does not have support for PARALLEL
120-
endif
121118

122119
# for "create extension from unpacked*":
123120

@@ -199,15 +196,12 @@ pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql: pgs_moc_compat.sql.in
199196

200197
pg_sphere--1.1.5beta4gavo--1.2.0.sql: pgs_moc_ops.sql.in
201198
cat $^ > $@
202-
ifeq ($(has_parallel), n)
203-
sed -i -e '/PARALLEL/d' $@ # version $(pg_version) does not have support for PARALLEL
204-
endif
205199

206200
pg_sphere--1.2.0--1.2.1.sql: pgs_moc_geo_casts.sql.in pgs_epochprop.sql.in
207201
cat $^ > $@
208-
ifeq ($(has_parallel), n)
209-
sed -i -e '/PARALLEL/d' $@ # version $(pg_version) does not have support for PARALLEL
210-
endif
202+
203+
pg_sphere--1.2.1--1.2.2.sql: upgrade_scripts/pg_sphere--1.2.1--1.2.2.sql.in
204+
cat $^ > $@
211205

212206
# end of local stuff
213207

Diff for: expected/init.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ CREATE EXTENSION pg_sphere;
66
select pg_sphere_version();
77
pg_sphere_version
88
-------------------
9-
1.2.1
9+
1.2.2
1010
(1 row)
1111

Diff for: gnomo.sql.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
CREATE OR REPLACE FUNCTION gnomonic_proj(spoint, spoint)
44
RETURNS point
55
AS 'MODULE_PATHNAME'
6-
LANGUAGE C IMMUTABLE STRICT;
6+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
77

88
COMMENT ON FUNCTION gnomonic_proj(spoint, spoint) IS
99
'gnomonic projection, the second argument is the tangential point';
1010

1111
CREATE OR REPLACE FUNCTION gnomonic_inv(point, spoint)
1212
RETURNS spoint
1313
AS 'MODULE_PATHNAME'
14-
LANGUAGE C IMMUTABLE STRICT;
14+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
1515

1616
COMMENT ON FUNCTION gnomonic_inv(point, spoint) IS
1717
'inverse of gnomonic projection, the second argument is the tangential point';

Diff for: healpix.sql.in

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,97 +3,97 @@
33
CREATE OR REPLACE FUNCTION nest2ring(integer, bigint)
44
RETURNS bigint
55
AS 'MODULE_PATHNAME', 'pg_nest2ring'
6-
LANGUAGE C IMMUTABLE STRICT;
6+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
77
COMMENT ON FUNCTION nest2ring(integer, bigint) IS
88
'converts nested Healpix index to a ring Healpix index for the specified integer level (first argument)';
99

1010
CREATE OR REPLACE FUNCTION ring2nest(integer, bigint)
1111
RETURNS bigint
1212
AS 'MODULE_PATHNAME', 'pg_ring2nest'
13-
LANGUAGE C IMMUTABLE STRICT;
13+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
1414
COMMENT ON FUNCTION ring2nest(integer, bigint) IS
1515
'converts ringe Healpix index to a nested Healpix index for the specified integer level (first argument)';
1616

1717
CREATE OR REPLACE FUNCTION healpix_convert_nest(integer, integer, bigint)
1818
RETURNS bigint
1919
AS 'MODULE_PATHNAME'
20-
LANGUAGE C IMMUTABLE STRICT;
20+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
2121
COMMENT ON FUNCTION healpix_convert_nest(integer, integer, bigint) IS
2222
'converts nested Healpix index (last argument) from level of second argument to level of first argument';
2323

2424
CREATE OR REPLACE FUNCTION healpix_convert_ring(integer, integer, bigint)
2525
RETURNS bigint
2626
AS 'MODULE_PATHNAME'
27-
LANGUAGE C IMMUTABLE STRICT;
27+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
2828
COMMENT ON FUNCTION healpix_convert_ring(integer, integer, bigint) IS
2929
'converts ring Healpix index (last argument) from level of second argument to level of first argument';
3030

3131
CREATE OR REPLACE FUNCTION nside2order(bigint)
3232
RETURNS integer
3333
AS 'MODULE_PATHNAME', 'pg_nside2order'
34-
LANGUAGE C IMMUTABLE STRICT;
34+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
3535
COMMENT ON FUNCTION nside2order(bigint) IS
3636
'returns integer part of base-two logarithm of argument for powers of two up to 29';
3737

3838
CREATE OR REPLACE FUNCTION order2nside(integer)
3939
RETURNS bigint
4040
AS 'MODULE_PATHNAME', 'pg_order2nside'
41-
LANGUAGE C IMMUTABLE STRICT;
41+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
4242
COMMENT ON FUNCTION order2nside(integer) IS
4343
'returns power of two for non-negative values up to 29';
4444

4545
CREATE OR REPLACE FUNCTION nside2npix(bigint)
4646
RETURNS bigint
4747
AS 'MODULE_PATHNAME', 'pg_nside2npix'
48-
LANGUAGE C IMMUTABLE STRICT;
48+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
4949
COMMENT ON FUNCTION nside2npix(bigint) IS
5050
'returns 12 * nside ^ 2, the number of Healpix elements for the nside parameter';
5151

5252
CREATE OR REPLACE FUNCTION npix2nside(bigint)
5353
RETURNS bigint
5454
AS 'MODULE_PATHNAME', 'pg_npix2nside'
55-
LANGUAGE C IMMUTABLE STRICT;
55+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
5656
COMMENT ON FUNCTION npix2nside(bigint) IS
5757
'returns the nside parameter correspondig to the number of Healpix elements';
5858

5959
CREATE OR REPLACE FUNCTION healpix_nest(integer, spoint)
6060
RETURNS bigint
6161
AS 'MODULE_PATHNAME'
62-
LANGUAGE C IMMUTABLE STRICT;
62+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
6363
COMMENT ON FUNCTION healpix_nest(integer, spoint) IS
6464
'nested Healpix index of a spherical point for the specified integer level (first argument)';
6565

6666
CREATE OR REPLACE FUNCTION healpix_ring(integer, spoint)
6767
RETURNS bigint
6868
AS 'MODULE_PATHNAME'
69-
LANGUAGE C IMMUTABLE STRICT;
69+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
7070
COMMENT ON FUNCTION healpix_ring(integer, spoint) IS
7171
'Healpix ring index of a spherical point for the specified integer level (first argument)';
7272

7373
CREATE OR REPLACE FUNCTION centre_of_healpix_nest(integer, bigint)
7474
RETURNS spoint
7575
AS 'MODULE_PATHNAME', 'inv_healpix_nest'
76-
LANGUAGE C IMMUTABLE STRICT;
76+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
7777
COMMENT ON FUNCTION centre_of_healpix_nest(integer, bigint) IS
7878
'spherical point designating the centre of a nested Healpix element for the specified integer level (first argument)';
7979

8080
CREATE OR REPLACE FUNCTION centre_of_healpix_ring(integer, bigint)
8181
RETURNS spoint
8282
AS 'MODULE_PATHNAME', 'inv_healpix_ring'
83-
LANGUAGE C IMMUTABLE STRICT;
83+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
8484
COMMENT ON FUNCTION centre_of_healpix_ring(integer, bigint) IS
8585
'spherical point designating the centre of a ring Healpix element for the specified integer level (first argument)';
8686

8787
CREATE OR REPLACE FUNCTION center_of_healpix_nest(integer, bigint)
8888
RETURNS spoint
8989
AS 'MODULE_PATHNAME', 'inv_healpix_nest'
90-
LANGUAGE C IMMUTABLE STRICT;
90+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
9191
COMMENT ON FUNCTION center_of_healpix_nest(integer, bigint) IS
9292
'spherical point designating the center of a nested Healpix element for the specified integer level (first argument)';
9393

9494
CREATE OR REPLACE FUNCTION center_of_healpix_ring(integer, bigint)
9595
RETURNS spoint
9696
AS 'MODULE_PATHNAME', 'inv_healpix_ring'
97-
LANGUAGE C IMMUTABLE STRICT;
97+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
9898
COMMENT ON FUNCTION center_of_healpix_ring(integer, bigint) IS
9999
'spherical point designating the center of a ring Healpix element for the specified integer level (first argument)';

Diff for: pg_sphere--1.2.2.sql.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- complain if this script is run via psql
2+
\echo Use "CREATE EXTENSION pg_sphere" to load this file. \quit

Diff for: pg_sphere.control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pg_sphere extension
22
comment = 'spherical objects with useful functions, operators and index support'
3-
default_version = '1.2.1'
3+
default_version = '1.2.2'
44
module_pathname = '$libdir/pg_sphere'
55
relocatable = true

0 commit comments

Comments
 (0)