PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pg_class.h File Reference
#include "catalog/genbki.h"
#include "catalog/pg_class_d.h"
Include dependency graph for pg_class.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CLASS_TUPLE_SIZE    (offsetof(FormData_pg_class,relminmxid) + sizeof(TransactionId))
 

Typedefs

typedef FormData_pg_classForm_pg_class
 

Functions

 CATALOG (pg_class, 1259, RelationRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83
 
Oid relnamespace BKI_DEFAULT (pg_catalog) BKI_LOOKUP(pg_namespace)
 
Oid reltype BKI_LOOKUP_OPT (pg_type)
 
Oid reloftype BKI_DEFAULT (0) BKI_LOOKUP_OPT(pg_type)
 
Oid relowner BKI_DEFAULT (POSTGRES) BKI_LOOKUP(pg_authid)
 
Oid relam BKI_DEFAULT (heap) BKI_LOOKUP_OPT(pg_am)
 
float4 reltuples BKI_DEFAULT (-1)
 
bool relhasindex BKI_DEFAULT (f)
 
char relpersistence BKI_DEFAULT (p)
 
char relkind BKI_DEFAULT (r)
 
bool relispopulated BKI_DEFAULT (t)
 
char relreplident BKI_DEFAULT (n)
 
TransactionId relfrozenxid BKI_DEFAULT (3)
 
TransactionId relminmxid BKI_DEFAULT (1)
 
 DECLARE_UNIQUE_INDEX_PKEY (pg_class_oid_index, 2662, ClassOidIndexId, pg_class, btree(oid oid_ops))
 
 DECLARE_UNIQUE_INDEX (pg_class_relname_nsp_index, 2663, ClassNameNspIndexId, pg_class, btree(relname name_ops, relnamespace oid_ops))
 
 DECLARE_INDEX (pg_class_tblspc_relfilenode_index, 3455, ClassTblspcRelfilenodeIndexId, pg_class, btree(reltablespace oid_ops, relfilenode oid_ops))
 
 MAKE_SYSCACHE (RELOID, pg_class_oid_index, 128)
 
 MAKE_SYSCACHE (RELNAMENSP, pg_class_relname_nsp_index, 128)
 
int errdetail_relkind_not_supported (char relkind)
 

Variables

RelationRelation_Rowtype_Id BKI_SCHEMA_MACRO
 
NameData relname
 
 FormData_pg_class
 

Macro Definition Documentation

◆ CLASS_TUPLE_SIZE

#define CLASS_TUPLE_SIZE    (offsetof(FormData_pg_class,relminmxid) + sizeof(TransactionId))

Definition at line 148 of file pg_class.h.

Typedef Documentation

◆ Form_pg_class

Definition at line 156 of file pg_class.h.

Function Documentation

◆ BKI_DEFAULT() [1/12]

float4 reltuples BKI_DEFAULT ( 1)

◆ BKI_DEFAULT() [2/12]

Oid reloftype BKI_DEFAULT ( )

◆ BKI_DEFAULT() [3/12]

TransactionId relminmxid BKI_DEFAULT ( )

◆ BKI_DEFAULT() [4/12]

TransactionId relfrozenxid BKI_DEFAULT ( )

◆ BKI_DEFAULT() [5/12]

bool relhasindex BKI_DEFAULT ( )

◆ BKI_DEFAULT() [6/12]

Oid relam BKI_DEFAULT ( heap  )

◆ BKI_DEFAULT() [7/12]

char relreplident BKI_DEFAULT ( )

◆ BKI_DEFAULT() [8/12]

char relpersistence BKI_DEFAULT ( )

◆ BKI_DEFAULT() [9/12]

Oid relnamespace BKI_DEFAULT ( pg_catalog  )

◆ BKI_DEFAULT() [10/12]

Oid relowner BKI_DEFAULT ( POSTGRES  )

◆ BKI_DEFAULT() [11/12]

char relkind BKI_DEFAULT ( )

◆ BKI_DEFAULT() [12/12]

bool relispopulated BKI_DEFAULT ( )

◆ BKI_LOOKUP_OPT()

Oid reltype BKI_LOOKUP_OPT ( pg_type  )

◆ CATALOG()

CATALOG ( pg_class  ,
1259  ,
RelationRelationId   
)

◆ DECLARE_INDEX()

DECLARE_INDEX ( pg_class_tblspc_relfilenode_index  ,
3455  ,
ClassTblspcRelfilenodeIndexId  ,
pg_class  ,
btree(reltablespace oid_ops, relfilenode oid_ops)   
)

◆ DECLARE_UNIQUE_INDEX()

DECLARE_UNIQUE_INDEX ( pg_class_relname_nsp_index  ,
2663  ,
ClassNameNspIndexId  ,
pg_class  ,
btree(relname name_ops, relnamespace oid_ops)   
)

◆ DECLARE_UNIQUE_INDEX_PKEY()

DECLARE_UNIQUE_INDEX_PKEY ( pg_class_oid_index  ,
2662  ,
ClassOidIndexId  ,
pg_class  ,
btree(oid oid_ops)   
)

◆ errdetail_relkind_not_supported()

int errdetail_relkind_not_supported ( char  relkind)

Definition at line 24 of file pg_class.c.

25{
26 switch (relkind)
27 {
28 case RELKIND_RELATION:
29 return errdetail("This operation is not supported for tables.");
30 case RELKIND_INDEX:
31 return errdetail("This operation is not supported for indexes.");
32 case RELKIND_SEQUENCE:
33 return errdetail("This operation is not supported for sequences.");
34 case RELKIND_TOASTVALUE:
35 return errdetail("This operation is not supported for TOAST tables.");
36 case RELKIND_VIEW:
37 return errdetail("This operation is not supported for views.");
38 case RELKIND_MATVIEW:
39 return errdetail("This operation is not supported for materialized views.");
40 case RELKIND_COMPOSITE_TYPE:
41 return errdetail("This operation is not supported for composite types.");
42 case RELKIND_FOREIGN_TABLE:
43 return errdetail("This operation is not supported for foreign tables.");
44 case RELKIND_PARTITIONED_TABLE:
45 return errdetail("This operation is not supported for partitioned tables.");
46 case RELKIND_PARTITIONED_INDEX:
47 return errdetail("This operation is not supported for partitioned indexes.");
48 default:
49 elog(ERROR, "unrecognized relkind: '%c'", relkind);
50 return 0;
51 }
52}
int errdetail(const char *fmt,...)
Definition: elog.c:1204
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:226

References elog, errdetail(), and ERROR.

Referenced by ATExecChangeOwner(), ATExecSetRelOptions(), ATSimplePermissions(), check_publication_add_relation(), check_relation_relkind(), CheckSubscriptionRelkind(), CommentObject(), CreateStatistics(), CreateTriggerFiringOn(), DefineIndex(), DefineQueryRewrite(), ExecSecLabelStmt(), get_raw_page_internal(), get_relation_info(), heap_force_common(), make_modifytable(), pg_freespace(), pg_relpages_impl(), pgstat_relation(), pgstattuple_approx_internal(), process_owned_by(), RangeVarCallbackForLockTable(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RemoveTriggerById(), renameatt_check(), stats_lock_check_privileges(), transformMergeStmt(), transformTableLikeClause(), validate_relation_kind(), and verify_heapam().

◆ MAKE_SYSCACHE() [1/2]

MAKE_SYSCACHE ( RELNAMENSP  ,
pg_class_relname_nsp_index  ,
128   
)

◆ MAKE_SYSCACHE() [2/2]

MAKE_SYSCACHE ( RELOID  ,
pg_class_oid_index  ,
128   
)

Variable Documentation

◆ BKI_SCHEMA_MACRO

RelationRelation_Rowtype_Id BKI_SCHEMA_MACRO
Initial value:
{
Oid oid
unsigned int Oid
Definition: postgres_ext.h:30

Definition at line 32 of file pg_class.h.

◆ FormData_pg_class

FormData_pg_class

Definition at line 145 of file pg_class.h.

Referenced by vac_update_datfrozenxid().

◆ relname

NameData relname

Definition at line 38 of file pg_class.h.

Referenced by AlterPublicationOptions(), attribute_statistics_update(), autoinc(), autovac_report_workitem(), boot_openrel(), bt_metap(), bt_multi_page_stats(), bt_page_items_internal(), bt_page_stats_internal(), build_tuplestore_recursively(), check_foreign_key(), check_new_partition_bound(), check_primary_key(), CheckSubscriptionRelkind(), ChooseRelationName(), closerel(), compile_relation_list_one_db(), connectby(), connectby_text(), connectby_text_serial(), conversion_error_callback(), cookConstraint(), currtid_byrelname(), DefineRelation(), deparseAnalyzeInfoSql(), deparseAnalyzeSizeSql(), deparseRelation(), describeOneTableDetails(), describeTableDetails(), DropErrorMsgWrongType(), errorMissingColumn(), ExecGrant_Attribute(), ExpandColumnRefStar(), fetch_remote_table_info(), fetch_table_list(), generate_qualified_relation_name(), generate_relation_name(), get_create_object_cmd(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_publication_rel(), get_object_address_relobject(), get_raw_page(), get_raw_page_1_9(), get_raw_page_fork(), get_raw_page_fork_1_9(), get_raw_page_internal(), get_relation_name(), get_relname_relid(), get_sql_delete(), get_sql_insert(), get_sql_update(), get_tuple_of_interest(), getRelationDescription(), heap_create(), heap_create_with_catalog(), heap_truncate_check_FKs(), insert_username(), LockTableRecurse(), LockViewRecurse_walker(), logicalrep_write_rel(), makeRangeVar(), map_sql_schema_to_xmlschema_types(), moddatetime(), overexplain_range_table(), pg_clear_attribute_stats(), pg_relpages(), pg_relpages_v1_5(), pgrowlocks(), pgstatindex(), pgstatindex_v1_5(), pgstattuple(), pgstattuple_v1_5(), postgresExplainForeignScan(), print_expr(), process_owned_by(), process_rel_infos(), ReindexPartitions(), relation_statistics_update(), RelationBuildLocalRelation(), RelationIsVisibleExt(), RelationNameGetTupleDesc(), RelnameGetRelid(), report_triggers(), stats_lookup_relid(), text_regclass(), transformColumnRef(), truncate_check_perms(), truncate_check_rel(), vacuum_is_permitted_for_relation(), and xpath_table().