 src/backend/commands/seclabel.c    |   29 +++++++++++++++++++++++++++++
 src/backend/utils/cache/catcache.c |    4 ++--
 src/backend/utils/cache/syscache.c |   12 ++++++++++++
 src/include/utils/syscache.h       |    1 +
 4 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index 7afb713..85f0ef8 100644
--- a/src/backend/commands/seclabel.c
+++ b/src/backend/commands/seclabel.c
@@ -15,12 +15,14 @@
 #include "catalog/catalog.h"
 #include "catalog/indexing.h"
 #include "catalog/namespace.h"
+#include "catalog/pg_largeobject.h"
 #include "catalog/pg_seclabel.h"
 #include "commands/seclabel.h"
 #include "miscadmin.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
+#include "utils/syscache.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/tqual.h"
@@ -150,6 +152,33 @@ GetSecurityLabel(const ObjectAddress *object, const char *provider)
 
 	Assert(!IsSharedRelation(object->classId));
 
+	/*
+	 * XXX - The reason why we don't reference security label of
+	 * large objects is the number of large objects being scanned
+	 * is unexpectable. If we would try to scan millions of objects,
+	 * the syscache mechanism must have a complex cache reclaim
+	 * mechanism. However, frequent cache flushing is fundamentally
+	 * nonsense. So, we always use raw scanning for large objects.
+	 */
+	if (object->classId != LargeObjectRelationId)
+	{
+		tuple = SearchSysCache4(SECLABELOID,
+								ObjectIdGetDatum(object->objectId),
+								ObjectIdGetDatum(object->classId),
+								Int32GetDatum(object->objectSubId),
+								CStringGetTextDatum(provider));
+		if (HeapTupleIsValid(tuple))
+		{
+			datum = SysCacheGetAttr(SECLABELOID, tuple,
+									Anum_pg_seclabel_label, &isnull);
+			if (!isnull)
+				seclabel = TextDatumGetCString(datum);
+
+			ReleaseSysCache(tuple);
+		}
+		return seclabel;
+	}
+
 	ScanKeyInit(&keys[0],
 				Anum_pg_seclabel_objoid,
 				BTEqualStrategyNumber, F_OIDEQ,
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 350e040..68c3fde 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -20,6 +20,7 @@
 #include "access/relscan.h"
 #include "access/sysattr.h"
 #include "access/valid.h"
+#include "catalog/pg_collation.h"
 #include "catalog/pg_operator.h"
 #include "catalog/pg_type.h"
 #include "miscadmin.h"
@@ -934,8 +935,7 @@ CatalogCacheInitializeCache(CatCache *cache)
 		/* Fill in sk_strategy as well --- always standard equality */
 		cache->cc_skey[i].sk_strategy = BTEqualStrategyNumber;
 		cache->cc_skey[i].sk_subtype = InvalidOid;
-		/* Currently, there are no catcaches on collation-aware data types */
-		cache->cc_skey[i].sk_collation = InvalidOid;
+		cache->cc_skey[i].sk_collation = DEFAULT_COLLATION_OID;
 
 		CACHE4_elog(DEBUG2, "CatalogCacheInitializeCache %s %d %p",
 					cache->cc_relname,
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index 75f510c..faeac5f 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -44,6 +44,7 @@
 #include "catalog/pg_opfamily.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_rewrite.h"
+#include "catalog/pg_seclabel.h"
 #include "catalog/pg_statistic.h"
 #include "catalog/pg_tablespace.h"
 #include "catalog/pg_ts_config.h"
@@ -587,6 +588,17 @@ static const struct cachedesc cacheinfo[] = {
 		},
 		1024
 	},
+	{SecLabelRelationId,        /* SECLABELOID */
+		SecLabelObjectIndexId,
+		4,
+		{
+			Anum_pg_seclabel_objoid,
+			Anum_pg_seclabel_classoid,
+			Anum_pg_seclabel_objsubid,
+			Anum_pg_seclabel_provider
+		},
+		2048
+	},
 	{StatisticRelationId,		/* STATRELATTINH */
 		StatisticRelidAttnumInhIndexId,
 		3,
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index 55d2230..4fbbab5 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -73,6 +73,7 @@ enum SysCacheIdentifier
 	RELNAMENSP,
 	RELOID,
 	RULERELNAME,
+	SECLABELOID,
 	STATRELATTINH,
 	TABLESPACEOID,
 	TSCONFIGMAP,