summaryrefslogtreecommitdiff
path: root/src/include/utils/uuid.h
diff options
context:
space:
mode:
authorNeil Conway2007-01-28 16:16:54 +0000
committerNeil Conway2007-01-28 16:16:54 +0000
commita534068e0e4c373ef2fe956f9782cf252e1bdc1e (patch)
tree01b52b6d760d1cee3ff7862c5237adf2a7946b45 /src/include/utils/uuid.h
parenta8e0b660610de84550b5affb8c2b3f1b59e4c1eb (diff)
Add a new builtin type, "uuid". This implements a UUID type, similar to
that defined in RFC 4122. This patch includes the basic implementation, plus regression tests. Documentation and perhaps some additional functionality will come later. Catversion bumped. Patch from Gevik Babakhani; review from Peter, Tom, and myself.
Diffstat (limited to 'src/include/utils/uuid.h')
-rw-r--r--src/include/utils/uuid.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/utils/uuid.h b/src/include/utils/uuid.h
new file mode 100644
index 00000000000..12cb00a0b71
--- /dev/null
+++ b/src/include/utils/uuid.h
@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ *
+ * uuid.h
+ * Header file for the "uuid" data type.
+ *
+ * Copyright (c) 2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/utils/uuid.h,v 1.1 2007/01/28 16:16:54 neilc Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef UUID_H
+#define UUID_H
+
+/* guid size in bytes */
+#define UUID_LEN 16
+
+/* opaque struct; defined in uuid.c */
+typedef struct uuid_t uuid_t;
+
+/* fmgr interface macros */
+#define UUIDPGetDatum(X) PointerGetDatum(X)
+#define PG_RETURN_UUID_P(X) return UUIDPGetDatum(X)
+#define DatumGetUUIDP(X) ((uuid_t *) DatumGetPointer(X))
+#define PG_GETARG_UUID_P(X) DatumGetUUIDP(PG_GETARG_DATUM(X))
+
+#endif /* UUID_H */