Commit afee0435 authored by Tom Lane's avatar Tom Lane

Revert "Change pg_seclabel.provider and pg_shseclabel.provider to type "name"."

This reverts commit b82a7be6.  There
is a better (less invasive) way to fix it, which I will commit next.
parent 55c0da38
...@@ -5648,7 +5648,7 @@ ...@@ -5648,7 +5648,7 @@
<row> <row>
<entry><structfield>provider</structfield></entry> <entry><structfield>provider</structfield></entry>
<entry><type>name</type></entry> <entry><type>text</type></entry>
<entry></entry> <entry></entry>
<entry>The label provider associated with this label.</entry> <entry>The label provider associated with this label.</entry>
</row> </row>
...@@ -5937,7 +5937,7 @@ ...@@ -5937,7 +5937,7 @@
</row> </row>
<row> <row>
<entry><structfield>provider</structfield></entry> <entry><structfield>provider</structfield></entry>
<entry><type>name</type></entry> <entry><type>text</type></entry>
<entry></entry> <entry></entry>
<entry>The label provider associated with this label.</entry> <entry>The label provider associated with this label.</entry>
</row> </row>
...@@ -9025,7 +9025,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx ...@@ -9025,7 +9025,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
</row> </row>
<row> <row>
<entry><structfield>provider</structfield></entry> <entry><structfield>provider</structfield></entry>
<entry><type>name</type></entry> <entry><type>text</type></entry>
<entry><literal><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.provider</literal></entry> <entry><literal><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.provider</literal></entry>
<entry>The label provider associated with this label.</entry> <entry>The label provider associated with this label.</entry>
</row> </row>
......
...@@ -163,8 +163,8 @@ GetSharedSecurityLabel(const ObjectAddress *object, const char *provider) ...@@ -163,8 +163,8 @@ GetSharedSecurityLabel(const ObjectAddress *object, const char *provider)
ObjectIdGetDatum(object->classId)); ObjectIdGetDatum(object->classId));
ScanKeyInit(&keys[2], ScanKeyInit(&keys[2],
Anum_pg_shseclabel_provider, Anum_pg_shseclabel_provider,
BTEqualStrategyNumber, F_NAMEEQ, BTEqualStrategyNumber, F_TEXTEQ,
CStringGetDatum(provider)); CStringGetTextDatum(provider));
pg_shseclabel = heap_open(SharedSecLabelRelationId, AccessShareLock); pg_shseclabel = heap_open(SharedSecLabelRelationId, AccessShareLock);
...@@ -220,8 +220,8 @@ GetSecurityLabel(const ObjectAddress *object, const char *provider) ...@@ -220,8 +220,8 @@ GetSecurityLabel(const ObjectAddress *object, const char *provider)
Int32GetDatum(object->objectSubId)); Int32GetDatum(object->objectSubId));
ScanKeyInit(&keys[3], ScanKeyInit(&keys[3],
Anum_pg_seclabel_provider, Anum_pg_seclabel_provider,
BTEqualStrategyNumber, F_NAMEEQ, BTEqualStrategyNumber, F_TEXTEQ,
CStringGetDatum(provider)); CStringGetTextDatum(provider));
pg_seclabel = heap_open(SecLabelRelationId, AccessShareLock); pg_seclabel = heap_open(SecLabelRelationId, AccessShareLock);
...@@ -256,7 +256,6 @@ SetSharedSecurityLabel(const ObjectAddress *object, ...@@ -256,7 +256,6 @@ SetSharedSecurityLabel(const ObjectAddress *object,
SysScanDesc scan; SysScanDesc scan;
HeapTuple oldtup; HeapTuple oldtup;
HeapTuple newtup = NULL; HeapTuple newtup = NULL;
NameData providername;
Datum values[Natts_pg_shseclabel]; Datum values[Natts_pg_shseclabel];
bool nulls[Natts_pg_shseclabel]; bool nulls[Natts_pg_shseclabel];
bool replaces[Natts_pg_shseclabel]; bool replaces[Natts_pg_shseclabel];
...@@ -266,8 +265,7 @@ SetSharedSecurityLabel(const ObjectAddress *object, ...@@ -266,8 +265,7 @@ SetSharedSecurityLabel(const ObjectAddress *object,
memset(replaces, false, sizeof(replaces)); memset(replaces, false, sizeof(replaces));
values[Anum_pg_shseclabel_objoid - 1] = ObjectIdGetDatum(object->objectId); values[Anum_pg_shseclabel_objoid - 1] = ObjectIdGetDatum(object->objectId);
values[Anum_pg_shseclabel_classoid - 1] = ObjectIdGetDatum(object->classId); values[Anum_pg_shseclabel_classoid - 1] = ObjectIdGetDatum(object->classId);
namestrcpy(&providername, provider); values[Anum_pg_shseclabel_provider - 1] = CStringGetTextDatum(provider);
values[Anum_pg_shseclabel_provider - 1] = NameGetDatum(&providername);
if (label != NULL) if (label != NULL)
values[Anum_pg_shseclabel_label - 1] = CStringGetTextDatum(label); values[Anum_pg_shseclabel_label - 1] = CStringGetTextDatum(label);
...@@ -282,8 +280,8 @@ SetSharedSecurityLabel(const ObjectAddress *object, ...@@ -282,8 +280,8 @@ SetSharedSecurityLabel(const ObjectAddress *object,
ObjectIdGetDatum(object->classId)); ObjectIdGetDatum(object->classId));
ScanKeyInit(&keys[2], ScanKeyInit(&keys[2],
Anum_pg_shseclabel_provider, Anum_pg_shseclabel_provider,
BTEqualStrategyNumber, F_NAMEEQ, BTEqualStrategyNumber, F_TEXTEQ,
CStringGetDatum(provider)); CStringGetTextDatum(provider));
pg_shseclabel = heap_open(SharedSecLabelRelationId, RowExclusiveLock); pg_shseclabel = heap_open(SharedSecLabelRelationId, RowExclusiveLock);
...@@ -337,7 +335,6 @@ SetSecurityLabel(const ObjectAddress *object, ...@@ -337,7 +335,6 @@ SetSecurityLabel(const ObjectAddress *object,
SysScanDesc scan; SysScanDesc scan;
HeapTuple oldtup; HeapTuple oldtup;
HeapTuple newtup = NULL; HeapTuple newtup = NULL;
NameData providername;
Datum values[Natts_pg_seclabel]; Datum values[Natts_pg_seclabel];
bool nulls[Natts_pg_seclabel]; bool nulls[Natts_pg_seclabel];
bool replaces[Natts_pg_seclabel]; bool replaces[Natts_pg_seclabel];
...@@ -355,8 +352,7 @@ SetSecurityLabel(const ObjectAddress *object, ...@@ -355,8 +352,7 @@ SetSecurityLabel(const ObjectAddress *object,
values[Anum_pg_seclabel_objoid - 1] = ObjectIdGetDatum(object->objectId); values[Anum_pg_seclabel_objoid - 1] = ObjectIdGetDatum(object->objectId);
values[Anum_pg_seclabel_classoid - 1] = ObjectIdGetDatum(object->classId); values[Anum_pg_seclabel_classoid - 1] = ObjectIdGetDatum(object->classId);
values[Anum_pg_seclabel_objsubid - 1] = Int32GetDatum(object->objectSubId); values[Anum_pg_seclabel_objsubid - 1] = Int32GetDatum(object->objectSubId);
namestrcpy(&providername, provider); values[Anum_pg_seclabel_provider - 1] = CStringGetTextDatum(provider);
values[Anum_pg_seclabel_provider - 1] = NameGetDatum(&providername);
if (label != NULL) if (label != NULL)
values[Anum_pg_seclabel_label - 1] = CStringGetTextDatum(label); values[Anum_pg_seclabel_label - 1] = CStringGetTextDatum(label);
...@@ -375,8 +371,8 @@ SetSecurityLabel(const ObjectAddress *object, ...@@ -375,8 +371,8 @@ SetSecurityLabel(const ObjectAddress *object,
Int32GetDatum(object->objectSubId)); Int32GetDatum(object->objectSubId));
ScanKeyInit(&keys[3], ScanKeyInit(&keys[3],
Anum_pg_seclabel_provider, Anum_pg_seclabel_provider,
BTEqualStrategyNumber, F_NAMEEQ, BTEqualStrategyNumber, F_TEXTEQ,
CStringGetDatum(provider)); CStringGetTextDatum(provider));
pg_seclabel = heap_open(SecLabelRelationId, RowExclusiveLock); pg_seclabel = heap_open(SecLabelRelationId, RowExclusiveLock);
......
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 201505181 #define CATALOG_VERSION_NO 201505153
#endif #endif
...@@ -290,10 +290,10 @@ DECLARE_UNIQUE_INDEX(pg_default_acl_oid_index, 828, on pg_default_acl using btre ...@@ -290,10 +290,10 @@ DECLARE_UNIQUE_INDEX(pg_default_acl_oid_index, 828, on pg_default_acl using btre
DECLARE_UNIQUE_INDEX(pg_db_role_setting_databaseid_rol_index, 2965, on pg_db_role_setting using btree(setdatabase oid_ops, setrole oid_ops)); DECLARE_UNIQUE_INDEX(pg_db_role_setting_databaseid_rol_index, 2965, on pg_db_role_setting using btree(setdatabase oid_ops, setrole oid_ops));
#define DbRoleSettingDatidRolidIndexId 2965 #define DbRoleSettingDatidRolidIndexId 2965
DECLARE_UNIQUE_INDEX(pg_seclabel_object_index, 3597, on pg_seclabel using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops, provider name_ops)); DECLARE_UNIQUE_INDEX(pg_seclabel_object_index, 3597, on pg_seclabel using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops, provider text_ops));
#define SecLabelObjectIndexId 3597 #define SecLabelObjectIndexId 3597
DECLARE_UNIQUE_INDEX(pg_shseclabel_object_index, 3593, on pg_shseclabel using btree(objoid oid_ops, classoid oid_ops, provider name_ops)); DECLARE_UNIQUE_INDEX(pg_shseclabel_object_index, 3593, on pg_shseclabel using btree(objoid oid_ops, classoid oid_ops, provider text_ops));
#define SharedSecLabelObjectIndexId 3593 #define SharedSecLabelObjectIndexId 3593
DECLARE_UNIQUE_INDEX(pg_extension_oid_index, 3080, on pg_extension using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_extension_oid_index, 3080, on pg_extension using btree(oid oid_ops));
......
...@@ -25,9 +25,9 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS ...@@ -25,9 +25,9 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS
Oid objoid; /* OID of the object itself */ Oid objoid; /* OID of the object itself */
Oid classoid; /* OID of table containing the object */ Oid classoid; /* OID of table containing the object */
int32 objsubid; /* column number, or 0 if not used */ int32 objsubid; /* column number, or 0 if not used */
NameData provider; /* name of label provider */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label BKI_FORCE_NOT_NULL; /* security label of the object */ text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif #endif
} FormData_pg_seclabel; } FormData_pg_seclabel;
......
...@@ -24,9 +24,9 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS ...@@ -24,9 +24,9 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{ {
Oid objoid; /* OID of the shared object itself */ Oid objoid; /* OID of the shared object itself */
Oid classoid; /* OID of table containing the shared object */ Oid classoid; /* OID of table containing the shared object */
NameData provider; /* name of label provider */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label BKI_FORCE_NOT_NULL; /* security label of the object */ text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif #endif
} FormData_pg_shseclabel; } FormData_pg_shseclabel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment