summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2012-11-17 16:03:23 +0000
committerMarko Kreen2012-11-17 16:03:23 +0000
commit3c4005a786b3c97ac9fb8d5ae8cd2b2d18921838 (patch)
tree37ac2e7ac554f33a8521131057e3bd84982328fa
parent8b260fb9e80aef0a38b20080a936a5f9780135e7 (diff)
Use TYPTYPE symbolic constants
-rw-r--r--src/plproxy.h18
-rw-r--r--src/type.c14
2 files changed, 27 insertions, 5 deletions
diff --git a/src/plproxy.h b/src/plproxy.h
index 38185bd..5e73d05 100644
--- a/src/plproxy.h
+++ b/src/plproxy.h
@@ -114,6 +114,24 @@
#define PROARGMODE_TABLE 't'
#endif
+#ifndef TYPTYPE_BASE
+#define TYPTYPE_BASE 'b'
+#endif
+#ifndef TYPTYPE_COMPOSITE
+#define TYPTYPE_COMPOSITE 'c'
+#endif
+#ifndef TYPTYPE_DOMAIN
+#define TYPTYPE_DOMAIN 'd'
+#endif
+#ifndef TYPTYPE_ENUM
+#define TYPTYPE_ENUM 'e'
+#endif
+#ifndef TYPTYPE_PSEUDO
+#define TYPTYPE_PSEUDO 'p'
+#endif
+#ifndef TYPTYPE_RANGE
+#define TYPTYPE_RANGE 'r'
+#endif
/*
* Determine if this argument is to SPLIT
diff --git a/src/type.c b/src/type.c
index 313cd59..9c0b080 100644
--- a/src/type.c
+++ b/src/type.c
@@ -302,14 +302,18 @@ plproxy_find_type_info(ProxyFunction *func, Oid oid, bool for_send)
switch (s_type->typtype)
{
default:
- case 'p':
+ case TYPTYPE_RANGE:
+ plproxy_error(func, "unsupported type code: %s (%u)", namebuf, oid);
+ break;
+ case TYPTYPE_PSEUDO:
if (oid != VOIDOID)
plproxy_error(func, "unsupported pseudo type: %s (%u)",
namebuf, oid);
- case 'b':
- case 'c':
- case 'd':
- case 'e':
+ break;
+ case TYPTYPE_BASE:
+ case TYPTYPE_COMPOSITE:
+ case TYPTYPE_DOMAIN:
+ case TYPTYPE_ENUM:
break;
}