summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-11-01 10:26:18 -0500
committerJeff Carr <[email protected]>2025-11-01 10:26:18 -0500
commita8ee202a434b6929a2f5488be5b1c0a0e10d6c02 (patch)
tree811b002d5e46b2ca223f403f425e9c5962519466 /Makefile
parent9e2da246d52558670685ffe86c25787b55c6b4a6 (diff)
example .c file on windowsHEADmasterdevel
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ab46d8f..8da6b67 100644
--- a/Makefile
+++ b/Makefile
@@ -20,3 +20,16 @@ clean:
rm -f *.pb.go *.patch
-rm -f go.*
-go-mod-clean purge
+
+build:
+ go build -o add_two.dll -buildmode=c-shared
+ # PS D:\C\myextension> go build -o add_two.dll -buildmode=c-shared
+ # In PostgreSQL: open the query window (adjust path to your generated dynamically loaded library and header file (.dll, .h).
+ # CREATE FUNCTION add_two(int4) RETURNS int4
+ # AS 'D:/C/myextension/add_two.dll', 'add_two'
+ # LANGUAGE C STRICT;
+ # And finally test it:
+ # SELECT add_two(10)
+ # Result:
+ # add_two (integer)
+ # 1 13