Permalink
Browse files

Builds on windows

  • Loading branch information...
1 parent 5ccc46b commit ac27d4db6ebd1e9157cc26c62cb6a8fa0dd21b06 @theirix committed Oct 26, 2012
Showing with 33 additions and 29 deletions.
  1. +3 −0 Changes
  2. +2 −2 META.json
  3. +2 −2 Makefile
  4. +2 −1 README.md
  5. +1 −1 json_accessors.control
  6. +23 −23 src/json_accessors.c
View
@@ -1,5 +1,8 @@
Revision history for PostgreSQL extension.
+1.3.3 2012-10-07T010000
+ - Allowed to build on Windows
+
1.3.2 2012-10-04T193059
- Works with PostgreSQL 9.2
View
@@ -2,7 +2,7 @@
"name": "json_accessors",
"abstract": "JSON accessor functions",
"description": "Extension provides stored functions for accessing JSON fields by keys and converting JSON arrays.",
- "version": "1.3.2",
+ "version": "1.3.3",
"maintainer": [
"Eugene Seliverstov <theirix@gmail.com>"
],
@@ -11,7 +11,7 @@
"json_accessors": {
"file": "sql/json_accessors.sql",
"docfile": "doc/json_accessors.md",
- "version": "1.3.2"
+ "version": "1.3.3"
}
},
"prereqs": {
View
@@ -1,6 +1,6 @@
EXTENSION = json_accessors
-EXTVERSION = 1.3.2
-MODULE_big = json_accessors
+EXTVERSION = 1.3.3
+MODULE_big = $(EXTENSION)
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
DOCS = $(wildcard doc/*.md)
View
@@ -45,7 +45,7 @@ can be installed with your favourite method, i.e. `easy_install pgxnclient`.
C extension are best built and installed using [PGXS](http://www.postgresql.org/docs/9.1/static/extend-pgxs.html).
PGXS ensures that make is performed with needed compiler and flags. You only need GNU make and a compiler to build
-an extension on an almost any UNIX platform (Linux, Solaris, OS X).
+an extension on an almost any UNIX platform (Linux, Solaris, OS X).
Compilation:
@@ -71,6 +71,7 @@ appropriated permissions - create database, for example):
Use this method if you have a precompiled extension and do not want to install this with help of PGXS.
Or maybe you just do not have GNU make on a production server.
+Or if you use Windows (use MSVC 2008 for Postgres 9.1 and MSVC 2010 for Postgres 9.2).
Copy library to the PostgreSQL library directory:
View
@@ -1,5 +1,5 @@
# json_accessors extension
comment = 'postgresql json accessor functions'
-default_version = '1.3.2'
+default_version = '1.3.3'
module_pathname = '$libdir/json_accessors'
relocatable = true
View
@@ -77,29 +77,29 @@ bool extract_object_array(cJSON *elem, DatumPtr result);
/*
* Exported functions
*/
-Datum json_get_object(PG_FUNCTION_ARGS);
-Datum json_get_text(PG_FUNCTION_ARGS);
-Datum json_get_boolean(PG_FUNCTION_ARGS);
-Datum json_get_int(PG_FUNCTION_ARGS);
-Datum json_get_bigint(PG_FUNCTION_ARGS);
-Datum json_get_numeric(PG_FUNCTION_ARGS);
-Datum json_get_timestamp(PG_FUNCTION_ARGS);
-
-Datum json_array_to_object_array(PG_FUNCTION_ARGS);
-Datum json_array_to_text_array(PG_FUNCTION_ARGS);
-Datum json_array_to_boolean_array(PG_FUNCTION_ARGS);
-Datum json_array_to_int_array(PG_FUNCTION_ARGS);
-Datum json_array_to_bigint_array(PG_FUNCTION_ARGS);
-Datum json_array_to_numeric_array(PG_FUNCTION_ARGS);
-Datum json_array_to_timestamp_array(PG_FUNCTION_ARGS);
-
-Datum json_get_object_array(PG_FUNCTION_ARGS);
-Datum json_get_text_array(PG_FUNCTION_ARGS);
-Datum json_get_boolean_array(PG_FUNCTION_ARGS);
-Datum json_get_int_array(PG_FUNCTION_ARGS);
-Datum json_get_bigint_array(PG_FUNCTION_ARGS);
-Datum json_get_numeric_array(PG_FUNCTION_ARGS);
-Datum json_get_timestamp_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_object(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_text(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_boolean(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_int(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_bigint(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_numeric(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_timestamp(PG_FUNCTION_ARGS);
+
+PGDLLEXPORT Datum json_array_to_object_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_array_to_text_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_array_to_boolean_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_array_to_int_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_array_to_bigint_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_array_to_numeric_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_array_to_timestamp_array(PG_FUNCTION_ARGS);
+
+PGDLLEXPORT Datum json_get_object_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_text_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_boolean_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_int_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_bigint_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_numeric_array(PG_FUNCTION_ARGS);
+PGDLLEXPORT Datum json_get_timestamp_array(PG_FUNCTION_ARGS);

0 comments on commit ac27d4d

Please sign in to comment.