mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-05 21:16:56 +02:00
674b22a2a4
PostgreSQL type extensions for IP and MAC addresses. I needed to record IP and MAC level ethernet addresses in a data base, and I really didn't want to store them as plain strings, with no enforced error checking, so I put together the accompanying code as my first experiment with adding a data type to PostgreSQL. I then thought that this might be useful to others, both directly and as a very simple example of how to do this sort of thing, so here it is, in the hope that it will be useful.
21 lines
380 B
Makefile
21 lines
380 B
Makefile
# PostgreSQL type definitions for IP and MAC addresses.
|
|
|
|
all: ip.so mac.so
|
|
|
|
ip.so: ip.o
|
|
ld -Bshareable -o ip.so ip.o
|
|
|
|
ip.o: ip.c
|
|
cc -g -O -fPIC -I/usr/local/pgsql/include -c ip.c
|
|
|
|
mac.so: mac.o
|
|
ld -Bshareable -o mac.so mac.o
|
|
|
|
mac.o: mac.c mac.h
|
|
cc -g -O -fPIC -I/usr/local/pgsql/include -c mac.c
|
|
|
|
install: ip.so mac.so
|
|
install -c ip.so mac.so /usr/local/pgsql/modules
|
|
|
|
# eof
|