Update to the latest snapshots.

uuid-ossp patch has been outdated with irrelevant changes (for us),
so massage back in.

In head of postgresql, this is handled properly, so eventually the ossp patches
can go.
This commit is contained in:
Chris Rees 2014-07-30 18:21:47 +00:00
parent 89cdfc8da2
commit 421b8a5f6e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=363500
20 changed files with 507 additions and 528 deletions

View File

@ -2,8 +2,8 @@
# $FreeBSD$
PORTNAME?= postgresql
DISTVERSION?= 8.4.21
PORTREVISION?= 2
DISTVERSION?= 8.4.22
PORTREVISION?= 0
CATEGORIES?= databases
MASTER_SITES= PGSQL
MASTER_SITE_SUBDIR= source/v${DISTVERSION}
@ -25,7 +25,7 @@ ICU_PATCHFILE?= pg-8421-icu-2014-06-09.diff.gz
UNIQUENAME?= ${PORTNAME}${DISTVERSION:R:S/.//}
PKGINSTALL?= ${PKGDIR}/pkg-install${COMPONENT}
USE_BZIP2= yes
USES+= tar:bzip2
.if !defined(NO_BUILD)
USES+= gmake
GNU_CONFIGURE= yes

View File

@ -1,4 +1,4 @@
SHA256 (postgresql/postgresql-8.4.21.tar.bz2) = 388f67e59f2a16c27e84f50656f5d755adf3d0a883138366d091aa0c727c1e2c
SIZE (postgresql/postgresql-8.4.21.tar.bz2) = 14645050
SHA256 (postgresql/postgresql-8.4.22.tar.bz2) = 5c1d56ce77448706d9dd03b2896af19d9ab1b9b8dcdb96c39707c74675ca3826
SIZE (postgresql/postgresql-8.4.22.tar.bz2) = 14651732
SHA256 (postgresql/pg-8421-icu-2014-06-09.diff.gz) = 39b88088adbe4cbfa207db0dd0ed0411a34af762ac9fa967e84eef6bcf8821ad
SIZE (postgresql/pg-8421-icu-2014-06-09.diff.gz) = 4380

View File

@ -10,11 +10,21 @@
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-03-17 20:38:14.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-03-19 23:01:59.000000000 +0100
--- contrib/Makefile.orig 2014-03-21 09:09:12.000000000 +0100
+++ contrib/Makefile 2014-03-21 09:09:28.000000000 +0100
@@ -39,6 +39,7 @@
tablefunc \
test_parser \
tsearch2 \
+ uuid-ossp \
vacuumlo
ifeq ($(with_openssl),yes)
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-07-21 20:18:03.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-07-30 17:35:22.872934812 +0100
@@ -6,6 +6,10 @@
*
* $PostgreSQL: pgsql/contrib/uuid-ossp/uuid-ossp.c,v 1.12 2010/01/02 16:57:33 momjian Exp $
* $PostgreSQL: pgsql/contrib/uuid-ossp/uuid-ossp.c,v 1.11 2009/06/11 14:48:53 momjian Exp $
*
+ * Modified to use FreeBSD's built in uuid instead of ossp:
+ * Copyright (c) 2009 Andrew Gierth
@ -58,7 +68,7 @@
PG_MODULE_MAGIC;
@@ -64,163 +55,175 @@
@@ -64,177 +55,175 @@
PG_FUNCTION_INFO_V1(uuid_generate_v4);
PG_FUNCTION_INFO_V1(uuid_generate_v5);
@ -81,41 +91,45 @@
+ * that pg's internal storage of uuids is the simple byte-oriented
+ * binary format. */
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
-
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return buf;
-}
-
-
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-/*
- * We create a uuid_t object just once per session and re-use it for all
- * operations in this module. OSSP UUID caches the system MAC address and
- * other state in this object. Reusing the object has a number of benefits:
- * saving the cycles needed to fetch the system MAC address over and over,
- * reducing the amount of entropy we draw from /dev/urandom, and providing a
- * positive guarantee that successive generated V1-style UUIDs don't collide.
- * (On a machine fast enough to generate multiple UUIDs per microsecond,
- * or whatever the system's wall-clock resolution is, we'd otherwise risk
- * collisions whenever random initialization of the uuid_t's clock sequence
- * value chanced to produce duplicates.)
- *
- * However: when we're doing V3 or V5 UUID creation, uuid_make needs two
- * uuid_t objects, one holding the namespace UUID and one for the result.
- * It's unspecified whether it's safe to use the same uuid_t for both cases,
- * so let's cache a second uuid_t for use as the namespace holder object.
- */
-static uuid_t *
-get_cached_uuid_t(int which)
+static Datum
+internal_uuid_create(int v, unsigned char *ns, char *ptr, int len)
{
- uuid_rc_t rc;
-
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
- static uuid_t *cached_uuid[2] = {NULL, NULL};
+ char strbuf[40];
- if (cached_uuid[which] == NULL)
+ switch (v)
+ {
{
- uuid_rc_t rc;
+ case 0: /* constant-value uuids: nil, or namespace uuids */
+ strlcpy(strbuf, ptr, 37);
+ break;
+
- rc = uuid_create(&cached_uuid[which]);
- if (rc != UUID_RC_OK)
- {
- cached_uuid[which] = NULL;
- pguuid_complain(rc);
- }
+ case 4: default: /* random uuid */
+ {
+ sprintf(strbuf, "%08lx-%04x-%04x-%04x-%04x%08lx",
@ -126,23 +140,37 @@
+ (unsigned) (arc4random() & 0xffff),
+ (unsigned long) arc4random());
+ break;
+ }
}
- return cached_uuid[which];
-}
+
+ case 1: /* time/node-based uuids */
+ {
+ uuid_t uu;
+ uint32_t status = uuid_s_ok;
+ char *str = NULL;
+
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
+ uuid_create(&uu, &status);
+
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status == uuid_s_ok)
+ {
+ uuid_to_string(&uu, &str, &status);
+ if (status == uuid_s_ok)
+ {
+ strlcpy(strbuf, str, 37);
+
- return buf;
-}
+ /* PTR, if set, replaces the trailing characters of the uuid;
+ * this is to support v1mc, where a random multicast MAC is
+ * used instead of the physical one
@ -155,23 +183,6 @@
+ free(str);
+ }
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid;
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status != uuid_s_ok)
+ {
+ ereport(ERROR,
@ -181,7 +192,11 @@
+
+ break;
+ }
+
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-{
- uuid_rc_t rc;
+ case 3: /* namespace-based MD5 uuids */
+ {
+ /* we could use pg's md5(), but we're already pulling in libmd */
@ -201,7 +216,11 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
+ break;
+ }
+
@ -209,7 +228,7 @@
+ {
+ SHA_CTX ctx;
+ unsigned char buf[20];
+
+ SHA1_Init(&ctx);
+ SHA1_Update(&ctx, ns, 16);
+ SHA1_Update(&ctx, (unsigned char *)ptr, len);
@ -223,7 +242,18 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
+ break;
+ }
+ }
@ -275,20 +305,14 @@
-static Datum
-uuid_generate_internal(int mode, const uuid_t *ns, const char *name)
-{
- uuid_t *uuid;
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_make(uuid, mode, ns, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
+ return internal_uuid_create(0, NULL, "6ba7b814-9dad-11d1-80b4-00c04fd430c8", 36);
@ -313,26 +337,16 @@
-static Datum
-uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
-{
- uuid_t *ns_uuid;
- Datum result;
- uuid_rc_t rc;
- uuid_t *ns_uuid = get_cached_uuid_t(1);
-
- rc = uuid_create(&ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out, UUIDPGetDatum(ns))),
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out,
- UUIDPGetDatum(ns))),
- ns_uuid);
-
- result = uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
-
- rc = uuid_destroy(ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ char buf[20];
- return result;
- return uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
+ sprintf(buf, "-%04x-%04x%08lx",
+ (unsigned)((arc4random() & 0x3FFF) | 0x8000),
+ /* set IEEE802 multicast and local-admin bits */
@ -343,7 +357,7 @@
}
@@ -230,14 +233,15 @@
@@ -244,14 +233,15 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -361,7 +375,7 @@
}
@@ -247,5 +251,6 @@
@@ -261,5 +251,6 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -369,13 +383,3 @@
+ return internal_uuid_create(5, (unsigned char *)ns,
+ VARDATA(name), VARSIZE(name) - VARHDRSZ);
}
--- contrib/Makefile.orig 2014-03-21 09:09:12.000000000 +0100
+++ contrib/Makefile 2014-03-21 09:09:28.000000000 +0100
@@ -39,6 +39,7 @@
tablefunc \
test_parser \
tsearch2 \
+ uuid-ossp \
vacuumlo
ifeq ($(with_openssl),yes)

View File

@ -357,6 +357,7 @@ share/postgresql/snowball_create.sql
%%TZDATA%%share/postgresql/timezone/Antarctica/Rothera
%%TZDATA%%share/postgresql/timezone/Antarctica/South_Pole
%%TZDATA%%share/postgresql/timezone/Antarctica/Syowa
%%TZDATA%%share/postgresql/timezone/Antarctica/Troll
%%TZDATA%%share/postgresql/timezone/Antarctica/Vostok
%%TZDATA%%share/postgresql/timezone/Arctic/Longyearbyen
%%TZDATA%%share/postgresql/timezone/Asia/Aden

View File

@ -1,7 +1,7 @@
# Created by: Marc G. Fournier <scrappy@FreeBSD.org>
# $FreeBSD$
DISTVERSION?= 9.0.17
DISTVERSION?= 9.0.18
PORTREVISION= 0
PKGNAMESUFFIX?= ${DISTVERSION:R:S/.//}${COMPONENT}

View File

@ -1,4 +1,4 @@
SHA256 (postgresql/postgresql-9.0.17.tar.bz2) = d2f6d09cf941e7cbab6ee399f14080dbe822af58fda9fd132efb05c2b7d160ad
SIZE (postgresql/postgresql-9.0.17.tar.bz2) = 14961682
SHA256 (postgresql/postgresql-9.0.18.tar.bz2) = 7c8a07d0ab78fe39522c6bb268a7b357f456d9d4796f57d7b43a004e4a9d3003
SIZE (postgresql/postgresql-9.0.18.tar.bz2) = 14984096
SHA256 (postgresql/pg-9017-icu-2014-06-09.diff.gz) = a28988885b532e73c2d6e67c6d2d9593f34d4360f2b4c9f6c419a373e16f149f
SIZE (postgresql/pg-9017-icu-2014-06-09.diff.gz) = 4395

View File

@ -1,17 +1,15 @@
--- contrib/uuid-ossp/Makefile.orig 2014-03-17 20:38:14.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-03-19 23:02:37.000000000 +0100
@@ -5,8 +5,8 @@
DATA_built = uuid-ossp.sql
DATA = uninstall_uuid-ossp.sql
--- contrib/Makefile.orig 2014-07-21 20:16:01.000000000 +0100
+++ contrib/Makefile 2014-07-30 17:59:54.904934814 +0100
@@ -43,6 +43,7 @@
tablefunc \
test_parser \
tsearch2 \
+ uuid-ossp \
unaccent \
vacuumlo
-SHLIB_LINK += $(OSSP_UUID_LIBS)
+SHLIB_LINK += -lmd
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-03-17 20:38:14.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-03-19 23:01:59.000000000 +0100
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-07-21 20:16:01.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-07-30 18:00:21.427935273 +0100
@@ -6,6 +6,10 @@
*
* $PostgreSQL: pgsql/contrib/uuid-ossp/uuid-ossp.c,v 1.12 2010/01/02 16:57:33 momjian Exp $
@ -58,7 +56,7 @@
PG_MODULE_MAGIC;
@@ -64,163 +55,175 @@
@@ -64,177 +55,175 @@
PG_FUNCTION_INFO_V1(uuid_generate_v4);
PG_FUNCTION_INFO_V1(uuid_generate_v5);
@ -81,41 +79,45 @@
+ * that pg's internal storage of uuids is the simple byte-oriented
+ * binary format. */
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
-
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return buf;
-}
-
-
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-/*
- * We create a uuid_t object just once per session and re-use it for all
- * operations in this module. OSSP UUID caches the system MAC address and
- * other state in this object. Reusing the object has a number of benefits:
- * saving the cycles needed to fetch the system MAC address over and over,
- * reducing the amount of entropy we draw from /dev/urandom, and providing a
- * positive guarantee that successive generated V1-style UUIDs don't collide.
- * (On a machine fast enough to generate multiple UUIDs per microsecond,
- * or whatever the system's wall-clock resolution is, we'd otherwise risk
- * collisions whenever random initialization of the uuid_t's clock sequence
- * value chanced to produce duplicates.)
- *
- * However: when we're doing V3 or V5 UUID creation, uuid_make needs two
- * uuid_t objects, one holding the namespace UUID and one for the result.
- * It's unspecified whether it's safe to use the same uuid_t for both cases,
- * so let's cache a second uuid_t for use as the namespace holder object.
- */
-static uuid_t *
-get_cached_uuid_t(int which)
+static Datum
+internal_uuid_create(int v, unsigned char *ns, char *ptr, int len)
{
- uuid_rc_t rc;
-
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
- static uuid_t *cached_uuid[2] = {NULL, NULL};
+ char strbuf[40];
- if (cached_uuid[which] == NULL)
+ switch (v)
+ {
{
- uuid_rc_t rc;
+ case 0: /* constant-value uuids: nil, or namespace uuids */
+ strlcpy(strbuf, ptr, 37);
+ break;
+
- rc = uuid_create(&cached_uuid[which]);
- if (rc != UUID_RC_OK)
- {
- cached_uuid[which] = NULL;
- pguuid_complain(rc);
- }
+ case 4: default: /* random uuid */
+ {
+ sprintf(strbuf, "%08lx-%04x-%04x-%04x-%04x%08lx",
@ -126,23 +128,37 @@
+ (unsigned) (arc4random() & 0xffff),
+ (unsigned long) arc4random());
+ break;
+ }
}
- return cached_uuid[which];
-}
+
+ case 1: /* time/node-based uuids */
+ {
+ uuid_t uu;
+ uint32_t status = uuid_s_ok;
+ char *str = NULL;
+
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
+ uuid_create(&uu, &status);
+
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status == uuid_s_ok)
+ {
+ uuid_to_string(&uu, &str, &status);
+ if (status == uuid_s_ok)
+ {
+ strlcpy(strbuf, str, 37);
+
- return buf;
-}
+ /* PTR, if set, replaces the trailing characters of the uuid;
+ * this is to support v1mc, where a random multicast MAC is
+ * used instead of the physical one
@ -155,23 +171,6 @@
+ free(str);
+ }
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid;
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status != uuid_s_ok)
+ {
+ ereport(ERROR,
@ -181,7 +180,11 @@
+
+ break;
+ }
+
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-{
- uuid_rc_t rc;
+ case 3: /* namespace-based MD5 uuids */
+ {
+ /* we could use pg's md5(), but we're already pulling in libmd */
@ -201,7 +204,11 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
+ break;
+ }
+
@ -209,7 +216,7 @@
+ {
+ SHA_CTX ctx;
+ unsigned char buf[20];
+
+ SHA1_Init(&ctx);
+ SHA1_Update(&ctx, ns, 16);
+ SHA1_Update(&ctx, (unsigned char *)ptr, len);
@ -223,7 +230,18 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
+ break;
+ }
+ }
@ -275,20 +293,14 @@
-static Datum
-uuid_generate_internal(int mode, const uuid_t *ns, const char *name)
-{
- uuid_t *uuid;
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_make(uuid, mode, ns, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
+ return internal_uuid_create(0, NULL, "6ba7b814-9dad-11d1-80b4-00c04fd430c8", 36);
@ -313,26 +325,16 @@
-static Datum
-uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
-{
- uuid_t *ns_uuid;
- Datum result;
- uuid_rc_t rc;
- uuid_t *ns_uuid = get_cached_uuid_t(1);
-
- rc = uuid_create(&ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out, UUIDPGetDatum(ns))),
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out,
- UUIDPGetDatum(ns))),
- ns_uuid);
-
- result = uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
-
- rc = uuid_destroy(ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ char buf[20];
- return result;
- return uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
+ sprintf(buf, "-%04x-%04x%08lx",
+ (unsigned)((arc4random() & 0x3FFF) | 0x8000),
+ /* set IEEE802 multicast and local-admin bits */
@ -343,7 +345,7 @@
}
@@ -230,14 +233,15 @@
@@ -244,14 +233,15 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -361,7 +363,7 @@
}
@@ -247,5 +251,6 @@
@@ -261,5 +251,6 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -369,13 +371,14 @@
+ return internal_uuid_create(5, (unsigned char *)ns,
+ VARDATA(name), VARSIZE(name) - VARHDRSZ);
}
--- contrib/Makefile.orig 2014-03-21 08:54:03.000000000 +0100
+++ contrib/Makefile 2014-03-21 08:54:08.000000000 +0100
@@ -43,6 +43,7 @@
tablefunc \
test_parser \
tsearch2 \
+ uuid-ossp \
unaccent \
vacuumlo
--- contrib/uuid-ossp/Makefile.orig 2014-07-21 20:16:01.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-07-30 18:00:13.141935988 +0100
@@ -5,7 +5,7 @@
DATA_built = uuid-ossp.sql
DATA = uninstall_uuid-ossp.sql
-SHLIB_LINK += $(OSSP_UUID_LIBS)
+SHLIB_LINK += -lmd
ifdef USE_PGXS
PG_CONFIG = pg_config

View File

@ -365,6 +365,7 @@ share/postgresql/snowball_create.sql
%%TZDATA%%share/postgresql/timezone/Antarctica/Rothera
%%TZDATA%%share/postgresql/timezone/Antarctica/South_Pole
%%TZDATA%%share/postgresql/timezone/Antarctica/Syowa
%%TZDATA%%share/postgresql/timezone/Antarctica/Troll
%%TZDATA%%share/postgresql/timezone/Antarctica/Vostok
%%TZDATA%%share/postgresql/timezone/Arctic/Longyearbyen
%%TZDATA%%share/postgresql/timezone/Asia/Aden

View File

@ -2,8 +2,8 @@
# $FreeBSD$
PORTNAME?= postgresql
DISTVERSION?= 9.1.13
PORTREVISION?= 2
DISTVERSION?= 9.1.14
PORTREVISION?= 0
CATEGORIES?= databases
MASTER_SITES= PGSQL
MASTER_SITE_SUBDIR= source/v${DISTVERSION}
@ -29,7 +29,7 @@ UNIQUENAME?= ${PORTNAME}${DISTVERSION:R:S/.//}${PKGNAMESUFFIX}
.endif
PKGINSTALL?= ${PKGDIR}/pkg-install${COMPONENT}
USE_BZIP2= yes
USES+= tar:bzip2
.if !defined(NO_BUILD)
USES+= gmake
GNU_CONFIGURE= yes

View File

@ -1,4 +1,4 @@
SHA256 (postgresql/postgresql-9.1.13.tar.bz2) = 20f8aa5dfcb47688ca6b6c41340cac61712d9cf87c34d58b0a75bb2f85d89b7f
SIZE (postgresql/postgresql-9.1.13.tar.bz2) = 15652239
SHA256 (postgresql/postgresql-9.1.14.tar.bz2) = d0647ce563d18ae02bf68c5dd646a4c75e8b45b3a4fada64d481371fdc16f522
SIZE (postgresql/postgresql-9.1.14.tar.bz2) = 15666442
SHA256 (postgresql/pg-928-icu-2014-06-09.diff.gz) = 6f856ee0fd27118650f806fb674220d9851a0183ffa125e6fbe5468dfabeea5c
SIZE (postgresql/pg-928-icu-2014-06-09.diff.gz) = 4449

View File

@ -1,5 +1,15 @@
--- contrib/uuid-ossp/Makefile.orig 2014-03-17 20:36:46.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-03-19 21:19:28.000000000 +0100
--- contrib/Makefile.orig 2014-07-21 20:14:13.000000000 +0100
+++ contrib/Makefile 2014-07-30 18:07:16.305934690 +0100
@@ -48,6 +48,7 @@
test_parser \
tsearch2 \
unaccent \
+ uuid-ossp \
vacuumlo
ifeq ($(with_openssl),yes)
--- contrib/uuid-ossp/Makefile.orig 2014-07-21 20:14:13.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-07-30 18:07:06.646935377 +0100
@@ -1,12 +1,14 @@
# contrib/uuid-ossp/Makefile
+# modified using http://pgfoundry.org/projects/uuid-freebsd/
@ -17,23 +27,8 @@
ifdef USE_PGXS
PG_CONFIG = pg_config
--- contrib/uuid-ossp/uuid-ossp--1.0.sql.orig 2014-03-17 20:36:46.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp--1.0.sql 2014-03-19 21:19:28.000000000 +0100
@@ -1,5 +1,12 @@
/* contrib/uuid-ossp/uuid-ossp--1.0.sql */
+-- this module is modified by girgen@ for FreeBSD using
+-- http://pgfoundry.org/projects/uuid-freebsd/
+-- based on the work of Andrew Gierth.
+-- The name is still uuid-ossp to maintain verbatim compatibility
+-- with the original ossp based module, although the built-in libc
+-- routines are actually used instead, not ossp.
+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use '''CREATE EXTENSION "uuid-ossp"''' to load this file. \quit
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-03-17 20:36:46.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-03-19 21:20:56.000000000 +0100
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-07-21 20:14:13.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-07-30 18:07:00.309934687 +0100
@@ -6,6 +6,10 @@
*
* contrib/uuid-ossp/uuid-ossp.c
@ -80,7 +75,7 @@
PG_MODULE_MAGIC;
@@ -64,163 +55,175 @@
@@ -64,177 +55,175 @@
PG_FUNCTION_INFO_V1(uuid_generate_v4);
PG_FUNCTION_INFO_V1(uuid_generate_v5);
@ -103,41 +98,45 @@
+ * that pg's internal storage of uuids is the simple byte-oriented
+ * binary format. */
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
-
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return buf;
-}
-
-
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-/*
- * We create a uuid_t object just once per session and re-use it for all
- * operations in this module. OSSP UUID caches the system MAC address and
- * other state in this object. Reusing the object has a number of benefits:
- * saving the cycles needed to fetch the system MAC address over and over,
- * reducing the amount of entropy we draw from /dev/urandom, and providing a
- * positive guarantee that successive generated V1-style UUIDs don't collide.
- * (On a machine fast enough to generate multiple UUIDs per microsecond,
- * or whatever the system's wall-clock resolution is, we'd otherwise risk
- * collisions whenever random initialization of the uuid_t's clock sequence
- * value chanced to produce duplicates.)
- *
- * However: when we're doing V3 or V5 UUID creation, uuid_make needs two
- * uuid_t objects, one holding the namespace UUID and one for the result.
- * It's unspecified whether it's safe to use the same uuid_t for both cases,
- * so let's cache a second uuid_t for use as the namespace holder object.
- */
-static uuid_t *
-get_cached_uuid_t(int which)
+static Datum
+internal_uuid_create(int v, unsigned char *ns, char *ptr, int len)
{
- uuid_rc_t rc;
-
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
- static uuid_t *cached_uuid[2] = {NULL, NULL};
+ char strbuf[40];
- if (cached_uuid[which] == NULL)
+ switch (v)
+ {
{
- uuid_rc_t rc;
+ case 0: /* constant-value uuids: nil, or namespace uuids */
+ strlcpy(strbuf, ptr, 37);
+ break;
+
- rc = uuid_create(&cached_uuid[which]);
- if (rc != UUID_RC_OK)
- {
- cached_uuid[which] = NULL;
- pguuid_complain(rc);
- }
+ case 4: default: /* random uuid */
+ {
+ sprintf(strbuf, "%08lx-%04x-%04x-%04x-%04x%08lx",
@ -148,23 +147,37 @@
+ (unsigned) (arc4random() & 0xffff),
+ (unsigned long) arc4random());
+ break;
+ }
}
- return cached_uuid[which];
-}
+
+ case 1: /* time/node-based uuids */
+ {
+ uuid_t uu;
+ uint32_t status = uuid_s_ok;
+ char *str = NULL;
+
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
+ uuid_create(&uu, &status);
+
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status == uuid_s_ok)
+ {
+ uuid_to_string(&uu, &str, &status);
+ if (status == uuid_s_ok)
+ {
+ strlcpy(strbuf, str, 37);
+
- return buf;
-}
+ /* PTR, if set, replaces the trailing characters of the uuid;
+ * this is to support v1mc, where a random multicast MAC is
+ * used instead of the physical one
@ -177,23 +190,6 @@
+ free(str);
+ }
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid;
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status != uuid_s_ok)
+ {
+ ereport(ERROR,
@ -203,7 +199,11 @@
+
+ break;
+ }
+
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-{
- uuid_rc_t rc;
+ case 3: /* namespace-based MD5 uuids */
+ {
+ /* we could use pg's md5(), but we're already pulling in libmd */
@ -223,7 +223,11 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
+ break;
+ }
+
@ -231,7 +235,7 @@
+ {
+ SHA_CTX ctx;
+ unsigned char buf[20];
+
+ SHA1_Init(&ctx);
+ SHA1_Update(&ctx, ns, 16);
+ SHA1_Update(&ctx, (unsigned char *)ptr, len);
@ -245,7 +249,18 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
+ break;
+ }
+ }
@ -297,20 +312,14 @@
-static Datum
-uuid_generate_internal(int mode, const uuid_t *ns, const char *name)
-{
- uuid_t *uuid;
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_make(uuid, mode, ns, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
+ return internal_uuid_create(0, NULL, "6ba7b814-9dad-11d1-80b4-00c04fd430c8", 36);
@ -335,26 +344,16 @@
-static Datum
-uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
-{
- uuid_t *ns_uuid;
- Datum result;
- uuid_rc_t rc;
- uuid_t *ns_uuid = get_cached_uuid_t(1);
-
- rc = uuid_create(&ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out, UUIDPGetDatum(ns))),
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out,
- UUIDPGetDatum(ns))),
- ns_uuid);
-
- result = uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
-
- rc = uuid_destroy(ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ char buf[20];
- return result;
- return uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
+ sprintf(buf, "-%04x-%04x%08lx",
+ (unsigned)((arc4random() & 0x3FFF) | 0x8000),
+ /* set IEEE802 multicast and local-admin bits */
@ -365,7 +364,7 @@
}
@@ -230,14 +233,15 @@
@@ -244,14 +233,15 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -383,7 +382,7 @@
}
@@ -247,5 +251,6 @@
@@ -261,5 +251,6 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -391,13 +390,3 @@
+ return internal_uuid_create(5, (unsigned char *)ns,
+ VARDATA(name), VARSIZE(name) - VARHDRSZ);
}
--- contrib/Makefile.orig 2014-03-21 09:05:11.000000000 +0100
+++ contrib/Makefile 2014-03-21 09:05:29.000000000 +0100
@@ -48,6 +48,7 @@
test_parser \
tsearch2 \
unaccent \
+ uuid-ossp \
vacuumlo
ifeq ($(with_openssl),yes)

View File

@ -372,6 +372,7 @@ share/postgresql/snowball_create.sql
%%TZDATA%%share/postgresql/timezone/Antarctica/Rothera
%%TZDATA%%share/postgresql/timezone/Antarctica/South_Pole
%%TZDATA%%share/postgresql/timezone/Antarctica/Syowa
%%TZDATA%%share/postgresql/timezone/Antarctica/Troll
%%TZDATA%%share/postgresql/timezone/Antarctica/Vostok
%%TZDATA%%share/postgresql/timezone/Arctic/Longyearbyen
%%TZDATA%%share/postgresql/timezone/Asia/Aden

View File

@ -2,8 +2,8 @@
# $FreeBSD$
PORTNAME?= postgresql
DISTVERSION?= 9.2.8
PORTREVISION?= 2
DISTVERSION?= 9.2.9
PORTREVISION?= 0
CATEGORIES?= databases
MASTER_SITES= PGSQL
MASTER_SITE_SUBDIR= source/v${DISTVERSION}
@ -29,7 +29,7 @@ UNIQUENAME?= ${PORTNAME}${DISTVERSION:R:S/.//}${PKGNAMESUFFIX}
.endif
PKGINSTALL?= ${PKGDIR}/pkg-install${COMPONENT}
USE_BZIP2= yes
USES+= tar:bzip2
.if !defined(NO_BUILD)
USES+= gmake
GNU_CONFIGURE= yes

View File

@ -1,4 +1,4 @@
SHA256 (postgresql/postgresql-9.2.8.tar.bz2) = 568ba482340219097475cce9ab744766889692ee7c9df886563e8292d66ed87c
SIZE (postgresql/postgresql-9.2.8.tar.bz2) = 16263345
SHA256 (postgresql/postgresql-9.2.9.tar.bz2) = 94ec6d330f125b6fc725741293073b07d7d20cc3e7b8ed127bc3d14ad2370197
SIZE (postgresql/postgresql-9.2.9.tar.bz2) = 16269349
SHA256 (postgresql/pg-928-icu-2014-06-09.diff.gz) = 6f856ee0fd27118650f806fb674220d9851a0183ffa125e6fbe5468dfabeea5c
SIZE (postgresql/pg-928-icu-2014-06-09.diff.gz) = 4449

View File

@ -1,5 +1,15 @@
--- contrib/uuid-ossp/Makefile.orig 2014-03-17 20:36:46.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-03-19 21:19:28.000000000 +0100
--- contrib/Makefile.orig 2014-07-21 20:12:31.000000000 +0100
+++ contrib/Makefile 2014-07-30 18:15:30.332934684 +0100
@@ -50,6 +50,7 @@
test_parser \
tsearch2 \
unaccent \
+ uuid-ossp \
vacuumlo
ifeq ($(with_openssl),yes)
--- contrib/uuid-ossp/Makefile.orig 2014-07-21 20:12:31.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-07-30 18:15:36.370934674 +0100
@@ -1,12 +1,14 @@
# contrib/uuid-ossp/Makefile
+# modified using http://pgfoundry.org/projects/uuid-freebsd/
@ -17,23 +27,8 @@
ifdef USE_PGXS
PG_CONFIG = pg_config
--- contrib/uuid-ossp/uuid-ossp--1.0.sql.orig 2014-03-17 20:36:46.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp--1.0.sql 2014-03-19 21:19:28.000000000 +0100
@@ -1,5 +1,12 @@
/* contrib/uuid-ossp/uuid-ossp--1.0.sql */
+-- this module is modified by girgen@ for FreeBSD using
+-- http://pgfoundry.org/projects/uuid-freebsd/
+-- based on the work of Andrew Gierth.
+-- The name is still uuid-ossp to maintain verbatim compatibility
+-- with the original ossp based module, although the built-in libc
+-- routines are actually used instead, not ossp.
+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use '''CREATE EXTENSION "uuid-ossp"''' to load this file. \quit
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-03-17 20:36:46.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-03-19 21:20:56.000000000 +0100
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-07-21 20:12:31.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-07-30 18:15:44.843935308 +0100
@@ -6,6 +6,10 @@
*
* contrib/uuid-ossp/uuid-ossp.c
@ -80,7 +75,7 @@
PG_MODULE_MAGIC;
@@ -64,163 +55,175 @@
@@ -64,177 +55,175 @@
PG_FUNCTION_INFO_V1(uuid_generate_v4);
PG_FUNCTION_INFO_V1(uuid_generate_v5);
@ -103,41 +98,45 @@
+ * that pg's internal storage of uuids is the simple byte-oriented
+ * binary format. */
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
-
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return buf;
-}
-
-
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-/*
- * We create a uuid_t object just once per session and re-use it for all
- * operations in this module. OSSP UUID caches the system MAC address and
- * other state in this object. Reusing the object has a number of benefits:
- * saving the cycles needed to fetch the system MAC address over and over,
- * reducing the amount of entropy we draw from /dev/urandom, and providing a
- * positive guarantee that successive generated V1-style UUIDs don't collide.
- * (On a machine fast enough to generate multiple UUIDs per microsecond,
- * or whatever the system's wall-clock resolution is, we'd otherwise risk
- * collisions whenever random initialization of the uuid_t's clock sequence
- * value chanced to produce duplicates.)
- *
- * However: when we're doing V3 or V5 UUID creation, uuid_make needs two
- * uuid_t objects, one holding the namespace UUID and one for the result.
- * It's unspecified whether it's safe to use the same uuid_t for both cases,
- * so let's cache a second uuid_t for use as the namespace holder object.
- */
-static uuid_t *
-get_cached_uuid_t(int which)
+static Datum
+internal_uuid_create(int v, unsigned char *ns, char *ptr, int len)
{
- uuid_rc_t rc;
-
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
- static uuid_t *cached_uuid[2] = {NULL, NULL};
+ char strbuf[40];
- if (cached_uuid[which] == NULL)
+ switch (v)
+ {
{
- uuid_rc_t rc;
+ case 0: /* constant-value uuids: nil, or namespace uuids */
+ strlcpy(strbuf, ptr, 37);
+ break;
+
- rc = uuid_create(&cached_uuid[which]);
- if (rc != UUID_RC_OK)
- {
- cached_uuid[which] = NULL;
- pguuid_complain(rc);
- }
+ case 4: default: /* random uuid */
+ {
+ sprintf(strbuf, "%08lx-%04x-%04x-%04x-%04x%08lx",
@ -148,23 +147,37 @@
+ (unsigned) (arc4random() & 0xffff),
+ (unsigned long) arc4random());
+ break;
+ }
}
- return cached_uuid[which];
-}
+
+ case 1: /* time/node-based uuids */
+ {
+ uuid_t uu;
+ uint32_t status = uuid_s_ok;
+ char *str = NULL;
+
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
+ uuid_create(&uu, &status);
+
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status == uuid_s_ok)
+ {
+ uuid_to_string(&uu, &str, &status);
+ if (status == uuid_s_ok)
+ {
+ strlcpy(strbuf, str, 37);
+
- return buf;
-}
+ /* PTR, if set, replaces the trailing characters of the uuid;
+ * this is to support v1mc, where a random multicast MAC is
+ * used instead of the physical one
@ -177,23 +190,6 @@
+ free(str);
+ }
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid;
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status != uuid_s_ok)
+ {
+ ereport(ERROR,
@ -203,7 +199,11 @@
+
+ break;
+ }
+
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-{
- uuid_rc_t rc;
+ case 3: /* namespace-based MD5 uuids */
+ {
+ /* we could use pg's md5(), but we're already pulling in libmd */
@ -223,7 +223,11 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
+ break;
+ }
+
@ -231,7 +235,7 @@
+ {
+ SHA_CTX ctx;
+ unsigned char buf[20];
+
+ SHA1_Init(&ctx);
+ SHA1_Update(&ctx, ns, 16);
+ SHA1_Update(&ctx, (unsigned char *)ptr, len);
@ -245,7 +249,18 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
+ break;
+ }
+ }
@ -297,20 +312,14 @@
-static Datum
-uuid_generate_internal(int mode, const uuid_t *ns, const char *name)
-{
- uuid_t *uuid;
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_make(uuid, mode, ns, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
+ return internal_uuid_create(0, NULL, "6ba7b814-9dad-11d1-80b4-00c04fd430c8", 36);
@ -335,26 +344,16 @@
-static Datum
-uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
-{
- uuid_t *ns_uuid;
- Datum result;
- uuid_rc_t rc;
- uuid_t *ns_uuid = get_cached_uuid_t(1);
-
- rc = uuid_create(&ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out, UUIDPGetDatum(ns))),
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out,
- UUIDPGetDatum(ns))),
- ns_uuid);
-
- result = uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
-
- rc = uuid_destroy(ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ char buf[20];
- return result;
- return uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
+ sprintf(buf, "-%04x-%04x%08lx",
+ (unsigned)((arc4random() & 0x3FFF) | 0x8000),
+ /* set IEEE802 multicast and local-admin bits */
@ -365,7 +364,7 @@
}
@@ -230,14 +233,15 @@
@@ -244,14 +233,15 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -383,7 +382,7 @@
}
@@ -247,5 +251,6 @@
@@ -261,5 +251,6 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -391,13 +390,3 @@
+ return internal_uuid_create(5, (unsigned char *)ns,
+ VARDATA(name), VARSIZE(name) - VARHDRSZ);
}
--- contrib/Makefile.orig 2014-03-21 09:01:58.000000000 +0100
+++ contrib/Makefile 2014-03-21 09:02:16.000000000 +0100
@@ -50,6 +50,7 @@
test_parser \
tsearch2 \
unaccent \
+ uuid-ossp \
vacuumlo
ifeq ($(with_openssl),yes)

View File

@ -369,6 +369,7 @@ share/postgresql/snowball_create.sql
%%TZDATA%%share/postgresql/timezone/Antarctica/Rothera
%%TZDATA%%share/postgresql/timezone/Antarctica/South_Pole
%%TZDATA%%share/postgresql/timezone/Antarctica/Syowa
%%TZDATA%%share/postgresql/timezone/Antarctica/Troll
%%TZDATA%%share/postgresql/timezone/Antarctica/Vostok
%%TZDATA%%share/postgresql/timezone/Arctic/Longyearbyen
%%TZDATA%%share/postgresql/timezone/Asia/Aden

View File

@ -1,7 +1,7 @@
# Created by: Marc G. Fournier <scrappy@FreeBSD.org>
# $FreeBSD$
DISTVERSION?= 9.3.4
DISTVERSION?= 9.3.5
PORTREVISION?= 0
PKGNAMESUFFIX?= ${DISTVERSION:R:S/.//}${COMPONENT}

View File

@ -1,4 +1,4 @@
SHA256 (postgresql/postgresql-9.3.4.tar.bz2) = 9ee819574dfc8798a448dc23a99510d2d8924c2f8b49f8228cd77e4efc8a6621
SIZE (postgresql/postgresql-9.3.4.tar.bz2) = 16691447
SHA256 (postgresql/postgresql-9.3.5.tar.bz2) = 14176ffb1f90a189e7626214365be08ea2bfc26f26994bafb4235be314b9b4b0
SIZE (postgresql/postgresql-9.3.5.tar.bz2) = 16727725
SHA256 (postgresql/pg-928-icu-2014-06-09.diff.gz) = 6f856ee0fd27118650f806fb674220d9851a0183ffa125e6fbe5468dfabeea5c
SIZE (postgresql/pg-928-icu-2014-06-09.diff.gz) = 4449

View File

@ -1,5 +1,15 @@
--- contrib/uuid-ossp/Makefile.orig 2014-03-17 20:35:47.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-03-19 20:51:44.000000000 +0100
--- contrib/Makefile.orig 2014-07-21 20:10:42.000000000 +0100
+++ contrib/Makefile 2014-07-30 18:20:53.752934682 +0100
@@ -52,6 +52,7 @@
test_parser \
tsearch2 \
unaccent \
+ uuid-ossp \
vacuumlo \
worker_spi
--- contrib/uuid-ossp/Makefile.orig 2014-07-21 20:10:42.000000000 +0100
+++ contrib/uuid-ossp/Makefile 2014-07-30 18:20:46.582934838 +0100
@@ -1,12 +1,14 @@
# contrib/uuid-ossp/Makefile
+# modified using http://pgfoundry.org/projects/uuid-freebsd/
@ -17,23 +27,8 @@
ifdef USE_PGXS
PG_CONFIG = pg_config
--- contrib/uuid-ossp/uuid-ossp--1.0.sql.orig 2014-03-17 20:35:47.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp--1.0.sql 2014-03-19 20:51:44.000000000 +0100
@@ -1,5 +1,12 @@
/* contrib/uuid-ossp/uuid-ossp--1.0.sql */
+-- this module is modified by girgen@ for FreeBSD using
+-- http://pgfoundry.org/projects/uuid-freebsd/
+-- based on the work of Andrew Gierth.
+-- The name is still uuid-ossp to maintain verbatim compatibility
+-- with the original ossp based module, although the built-in libc
+-- routines are actually used instead, not ossp.
+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use '''CREATE EXTENSION "uuid-ossp"''' to load this file. \quit
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-03-17 20:35:47.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-03-19 21:12:11.000000000 +0100
--- contrib/uuid-ossp/uuid-ossp.c.orig 2014-07-21 20:10:42.000000000 +0100
+++ contrib/uuid-ossp/uuid-ossp.c 2014-07-30 18:20:38.611935303 +0100
@@ -1,11 +1,15 @@
/*-------------------------------------------------------------------------
*
@ -86,7 +81,7 @@
PG_MODULE_MAGIC;
@@ -64,163 +55,175 @@
@@ -64,177 +55,175 @@
PG_FUNCTION_INFO_V1(uuid_generate_v4);
PG_FUNCTION_INFO_V1(uuid_generate_v5);
@ -109,41 +104,45 @@
+ * that pg's internal storage of uuids is the simple byte-oriented
+ * binary format. */
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
-
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return buf;
-}
-
-
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-/*
- * We create a uuid_t object just once per session and re-use it for all
- * operations in this module. OSSP UUID caches the system MAC address and
- * other state in this object. Reusing the object has a number of benefits:
- * saving the cycles needed to fetch the system MAC address over and over,
- * reducing the amount of entropy we draw from /dev/urandom, and providing a
- * positive guarantee that successive generated V1-style UUIDs don't collide.
- * (On a machine fast enough to generate multiple UUIDs per microsecond,
- * or whatever the system's wall-clock resolution is, we'd otherwise risk
- * collisions whenever random initialization of the uuid_t's clock sequence
- * value chanced to produce duplicates.)
- *
- * However: when we're doing V3 or V5 UUID creation, uuid_make needs two
- * uuid_t objects, one holding the namespace UUID and one for the result.
- * It's unspecified whether it's safe to use the same uuid_t for both cases,
- * so let's cache a second uuid_t for use as the namespace holder object.
- */
-static uuid_t *
-get_cached_uuid_t(int which)
+static Datum
+internal_uuid_create(int v, unsigned char *ns, char *ptr, int len)
{
- uuid_rc_t rc;
-
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
- static uuid_t *cached_uuid[2] = {NULL, NULL};
+ char strbuf[40];
- if (cached_uuid[which] == NULL)
+ switch (v)
+ {
{
- uuid_rc_t rc;
+ case 0: /* constant-value uuids: nil, or namespace uuids */
+ strlcpy(strbuf, ptr, 37);
+ break;
+
- rc = uuid_create(&cached_uuid[which]);
- if (rc != UUID_RC_OK)
- {
- cached_uuid[which] = NULL;
- pguuid_complain(rc);
- }
+ case 4: default: /* random uuid */
+ {
+ sprintf(strbuf, "%08lx-%04x-%04x-%04x-%04x%08lx",
@ -154,23 +153,37 @@
+ (unsigned) (arc4random() & 0xffff),
+ (unsigned long) arc4random());
+ break;
+ }
}
- return cached_uuid[which];
-}
+
+ case 1: /* time/node-based uuids */
+ {
+ uuid_t uu;
+ uint32_t status = uuid_s_ok;
+ char *str = NULL;
+
-static char *
-uuid_to_string(const uuid_t *uuid)
-{
- char *buf = palloc(UUID_LEN_STR + 1);
- void *ptr = buf;
- size_t len = UUID_LEN_STR + 1;
- uuid_rc_t rc;
+ uuid_create(&uu, &status);
+
- rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status == uuid_s_ok)
+ {
+ uuid_to_string(&uu, &str, &status);
+ if (status == uuid_s_ok)
+ {
+ strlcpy(strbuf, str, 37);
+
- return buf;
-}
+ /* PTR, if set, replaces the trailing characters of the uuid;
+ * this is to support v1mc, where a random multicast MAC is
+ * used instead of the physical one
@ -183,23 +196,6 @@
+ free(str);
+ }
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid;
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ if (status != uuid_s_ok)
+ {
+ ereport(ERROR,
@ -209,7 +205,11 @@
+
+ break;
+ }
+
-static void
-string_to_uuid(const char *str, uuid_t *uuid)
-{
- uuid_rc_t rc;
+ case 3: /* namespace-based MD5 uuids */
+ {
+ /* we could use pg's md5(), but we're already pulling in libmd */
@ -229,7 +229,11 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
- rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-}
+ break;
+ }
+
@ -237,7 +241,7 @@
+ {
+ SHA_CTX ctx;
+ unsigned char buf[20];
+
+ SHA1_Init(&ctx);
+ SHA1_Update(&ctx, ns, 16);
+ SHA1_Update(&ctx, (unsigned char *)ptr, len);
@ -251,7 +255,18 @@
+ buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
+ ((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
+ buf[12], buf[13], buf[14], buf[15]);
+
-static Datum
-special_uuid_value(const char *name)
-{
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_load(uuid, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
+ break;
+ }
+ }
@ -303,20 +318,14 @@
-static Datum
-uuid_generate_internal(int mode, const uuid_t *ns, const char *name)
-{
- uuid_t *uuid;
- uuid_t *uuid = get_cached_uuid_t(0);
- char *str;
- uuid_rc_t rc;
-
- rc = uuid_create(&uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- rc = uuid_make(uuid, mode, ns, name);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- str = uuid_to_string(uuid);
- rc = uuid_destroy(uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
-
- return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
+ return internal_uuid_create(0, NULL, "6ba7b814-9dad-11d1-80b4-00c04fd430c8", 36);
@ -341,26 +350,16 @@
-static Datum
-uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
-{
- uuid_t *ns_uuid;
- Datum result;
- uuid_rc_t rc;
- uuid_t *ns_uuid = get_cached_uuid_t(1);
-
- rc = uuid_create(&ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out, UUIDPGetDatum(ns))),
- string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out,
- UUIDPGetDatum(ns))),
- ns_uuid);
-
- result = uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
-
- rc = uuid_destroy(ns_uuid);
- if (rc != UUID_RC_OK)
- pguuid_complain(rc);
+ char buf[20];
- return result;
- return uuid_generate_internal(mode,
- ns_uuid,
- text_to_cstring(name));
+ sprintf(buf, "-%04x-%04x%08lx",
+ (unsigned)((arc4random() & 0x3FFF) | 0x8000),
+ /* set IEEE802 multicast and local-admin bits */
@ -371,7 +370,7 @@
}
@@ -230,14 +233,15 @@
@@ -244,14 +233,15 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -389,7 +388,7 @@
}
@@ -247,5 +251,6 @@
@@ -261,5 +251,6 @@
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
@ -397,13 +396,3 @@
+ return internal_uuid_create(5, (unsigned char *)ns,
+ VARDATA(name), VARSIZE(name) - VARHDRSZ);
}
--- contrib/Makefile.orig 2014-03-21 08:58:32.000000000 +0100
+++ contrib/Makefile 2014-03-21 08:59:13.000000000 +0100
@@ -52,6 +52,7 @@
test_parser \
tsearch2 \
unaccent \
+ uuid-ossp \
vacuumlo \
worker_spi

View File

@ -358,6 +358,7 @@ share/postgresql/snowball_create.sql
%%TZDATA%%share/postgresql/timezone/Antarctica/Rothera
%%TZDATA%%share/postgresql/timezone/Antarctica/South_Pole
%%TZDATA%%share/postgresql/timezone/Antarctica/Syowa
%%TZDATA%%share/postgresql/timezone/Antarctica/Troll
%%TZDATA%%share/postgresql/timezone/Antarctica/Vostok
%%TZDATA%%share/postgresql/timezone/Arctic/Longyearbyen
%%TZDATA%%share/postgresql/timezone/Asia/Aden