Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 74496bc

Browse files
committed
Contrib module uuid-ossp for generating UUID values using the OSSP UUID
library. New configure option --with-ossp-uuid to activate.
1 parent 71495f2 commit 74496bc

12 files changed

+421
-6
lines changed

configure

+36-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ ac_includes_default="\
314314
# include <unistd.h>
315315
#endif"
316316

317-
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug enable_profiling DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl XML2_CONFIG with_libxml with_libxslt with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
317+
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug enable_profiling DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl with_ossp_uuid XML2_CONFIG with_libxml with_libxslt with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
318318
ac_subst_files=''
319319

320320
# Initialize some variables set by options.
@@ -895,6 +895,7 @@ Optional Packages:
895895
--with-openssl build with OpenSSL support
896896
--without-readline do not use GNU Readline nor BSD Libedit for editing
897897
--with-libedit-preferred prefer BSD Libedit over GNU Readline
898+
--with-ossp-uuid build with OSSP UUID library for UUID generation
898899
--with-libxml build with XML support
899900
--with-libxslt build with XSLT support
900901
--without-zlib do not use Zlib
@@ -4241,6 +4242,39 @@ fi;
42414242

42424243

42434244

4245+
#
4246+
# OSSP UUID library
4247+
#
4248+
4249+
pgac_args="$pgac_args with_ossp_uuid"
4250+
4251+
4252+
# Check whether --with-ossp-uuid or --without-ossp-uuid was given.
4253+
if test "${with_ossp_uuid+set}" = set; then
4254+
withval="$with_ossp_uuid"
4255+
4256+
case $withval in
4257+
yes)
4258+
:
4259+
;;
4260+
no)
4261+
:
4262+
;;
4263+
*)
4264+
{ { echo "$as_me:$LINENO: error: no argument expected for --with-ossp-uuid option" >&5
4265+
echo "$as_me: error: no argument expected for --with-ossp-uuid option" >&2;}
4266+
{ (exit 1); exit 1; }; }
4267+
;;
4268+
esac
4269+
4270+
else
4271+
with_ossp_uuid=no
4272+
4273+
fi;
4274+
4275+
4276+
4277+
42444278
#
42454279
# XML
42464280
#
@@ -24589,6 +24623,7 @@ s,@with_pam@,$with_pam,;t t
2458924623
s,@with_ldap@,$with_ldap,;t t
2459024624
s,@with_bonjour@,$with_bonjour,;t t
2459124625
s,@with_openssl@,$with_openssl,;t t
24626+
s,@with_ossp_uuid@,$with_ossp_uuid,;t t
2459224627
s,@XML2_CONFIG@,$XML2_CONFIG,;t t
2459324628
s,@with_libxml@,$with_libxml,;t t
2459424629
s,@with_libxslt@,$with_libxslt,;t t

configure.in

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.511 2007/04/15 12:48:23 adunstan Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.512 2007/04/21 17:26:17 petere Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -555,6 +555,13 @@ PGAC_ARG_BOOL(with, libedit-preferred, no,
555555
[ --with-libedit-preferred prefer BSD Libedit over GNU Readline])
556556

557557

558+
#
559+
# OSSP UUID library
560+
#
561+
PGAC_ARG_BOOL(with, ossp-uuid, no, [ --with-ossp-uuid build with OSSP UUID library for UUID generation])
562+
AC_SUBST(with_ossp_uuid)
563+
564+
558565
#
559566
# XML
560567
#

contrib/Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/Makefile,v 1.74 2007/04/15 12:48:23 adunstan Exp $
1+
# $PostgreSQL: pgsql/contrib/Makefile,v 1.75 2007/04/21 17:26:17 petere Exp $
22

33
subdir = contrib
44
top_builddir = ..
@@ -37,6 +37,10 @@ ifeq ($(with_openssl),yes)
3737
WANTED_DIRS += sslinfo
3838
endif
3939

40+
ifeq ($(with_ossp_uuid),yes)
41+
WANTED_DIRS += uuid-ossp
42+
endif
43+
4044
ifeq ($(with_libxml),yes)
4145
ifeq ($(with_libxslt),yes)
4246
WANTED_DIRS += xml2

contrib/README

+4
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ tsearch2 -
133133
by Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov
134134
<oleg@sai.msu.su>.
135135

136+
uuid-ossp -
137+
UUID generation functions
138+
by Peter Eisentraut <peter_e@gmx.net>
139+
136140
vacuumlo -
137141
Remove orphaned large objects
138142
by Peter T Mount <peter@retep.org.uk>

contrib/uuid-ossp/Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# $PostgreSQL: pgsql/contrib/uuid-ossp/Makefile,v 1.1 2007/04/21 17:26:17 petere Exp $
2+
3+
MODULE_big = uuid-ossp
4+
OBJS = uuid-ossp.o
5+
DATA_built = uuid-ossp.sql
6+
DATA = uninstall_uuid-ossp.sql
7+
DOCS = README.uuid-ossp
8+
9+
SHLIB_LINK += -lossp-uuid
10+
11+
ifdef USE_PGXS
12+
PGXS := $(shell pg_config --pgxs)
13+
include $(PGXS)
14+
else
15+
subdir = contrib/uuid-ossp
16+
top_builddir = ../..
17+
include $(top_builddir)/src/Makefile.global
18+
include $(top_srcdir)/contrib/contrib-global.mk
19+
endif

contrib/uuid-ossp/README.uuid-ossp

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
UUID Generation Functions
2+
=========================
3+
Peter Eisentraut <peter_e@gmx.net>
4+
5+
This module provides functions to generate universally unique
6+
identifiers (UUIDs) using one of the several standard algorithms, as
7+
well as functions to produce certain special UUID constants.
8+
9+
10+
Installation
11+
------------
12+
13+
The extra library required can be found at
14+
<http://www.ossp.org/pkg/lib/uuid/>.
15+
16+
17+
UUID Generation
18+
---------------
19+
20+
The relevant standards ITU-T Rec. X.667, ISO/IEC 9834-8:2005, and RFC
21+
4122 specify four algorithms for generating UUIDs, identified by the
22+
version numbers 1, 3, 4, and 5. (There is no version 2 algorithm.)
23+
Each of these algorithms could be suitable for a different set of
24+
applications.
25+
26+
uuid_generate_v1()
27+
~~~~~~~~~~~~~~~~~~
28+
29+
This function generates a version 1 UUID. This involves the MAC
30+
address of the computer and a time stamp. Note that UUIDs of this
31+
kind reveal the identity of the computer that created the identifier
32+
and the time at which it did so, which might make it unsuitable for
33+
certain security-sensitive applications.
34+
35+
uuid_generate_v1mc()
36+
~~~~~~~~~~~~~~~~~~~~
37+
38+
This function generates a version 1 UUID but uses a random multicast
39+
MAC address instead of the real MAC address of the computer.
40+
41+
uuid_generate_v3(namespace uuid, name text)
42+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43+
44+
This function generates a version 3 UUID in the given namespace using
45+
the specified input name. The namespace should be one of the special
46+
constants produced by the uuid_ns_*() functions shown below. (It
47+
should be any UUID in theory.) The name is an identifier in the
48+
selected namespace. For example:
49+
50+
uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org')
51+
52+
The name parameter will be MD5-hashed, so the cleartext cannot be
53+
derived from the generated UUID.
54+
55+
The generation of UUIDs by this method has no random or
56+
environment-dependent element and is therefore reproducible.
57+
58+
uuid_generate_v4()
59+
~~~~~~~~~~~~~~~~~~
60+
61+
This function generates a version 4 UUID, which is derived entirely
62+
from random numbers.
63+
64+
uuid_generate_v5(namespace uuid, name text)
65+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66+
67+
This function generates a version 5 UUID, which works like a version 3
68+
UUID except that SHA-1 is used as a hashing method. Version 5 should
69+
be preferred over version 3 because SHA-1 is thought to be more secure
70+
than MD5.
71+
72+
73+
UUID Constants
74+
--------------
75+
76+
uuid_nil()
77+
78+
A "nil" UUID constant, which does not occur as a real UUID.
79+
80+
uuid_ns_dns()
81+
82+
Constant designating the DNS namespace for UUIDs.
83+
84+
uuid_ns_url()
85+
86+
Constant designating the URL namespace for UUIDs.
87+
88+
uuid_ns_oid()
89+
90+
Constant designating the ISO object identifier (OID) namespace for
91+
UUIDs. (This pertains to ASN.1 OIDs, unrelated to the OIDs used in
92+
PostgreSQL.)
93+
94+
uuid_ns_x500()
95+
96+
Constant designating the X.500 distinguished name (DN) namespace for
97+
UUIDs.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* $PostgreSQL: pgsql/contrib/uuid-ossp/uninstall_uuid-ossp.sql,v 1.1 2007/04/21 17:26:17 petere Exp $ */
2+
3+
SET search_path = public;
4+
5+
DROP FUNCTION uuid_nil();
6+
DROP FUNCTION uuid_ns_dns();
7+
DROP FUNCTION uuid_ns_url();
8+
DROP FUNCTION uuid_ns_oid();
9+
DROP FUNCTION uuid_ns_x500();
10+
11+
DROP FUNCTION uuid_generate_v1();
12+
DROP FUNCTION uuid_generate_v1mc();
13+
DROP FUNCTION uuid_generate_v3(namespace uuid, name text);
14+
DROP FUNCTION uuid_generate_v4();
15+
DROP FUNCTION uuid_generate_v5(namespace uuid, name text);

0 commit comments

Comments
 (0)