Header And Logo

PostgreSQL
| The world's most advanced open source database.

Defines | Functions

toasting.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DECLARE_TOAST(name, toastoid, indexoid)   extern int no_such_variable
#define PgShdescriptionToastTable   2846
#define PgShdescriptionToastIndex   2847
#define PgDbRoleSettingToastTable   2966
#define PgDbRoleSettingToastIndex   2967

Functions

void AlterTableCreateToastTable (Oid relOid, Datum reloptions)
void BootstrapToastTable (char *relName, Oid toastOid, Oid toastIndexOid)
 DECLARE_TOAST (pg_attrdef, 2830, 2831)
 DECLARE_TOAST (pg_constraint, 2832, 2833)
 DECLARE_TOAST (pg_description, 2834, 2835)
 DECLARE_TOAST (pg_proc, 2836, 2837)
 DECLARE_TOAST (pg_rewrite, 2838, 2839)
 DECLARE_TOAST (pg_seclabel, 3598, 3599)
 DECLARE_TOAST (pg_statistic, 2840, 2841)
 DECLARE_TOAST (pg_trigger, 2336, 2337)
 DECLARE_TOAST (pg_shdescription, 2846, 2847)
 DECLARE_TOAST (pg_db_role_setting, 2966, 2967)

Define Documentation

#define DECLARE_TOAST (   name,
  toastoid,
  indexoid 
)    extern int no_such_variable

Definition at line 29 of file toasting.h.

#define PgDbRoleSettingToastIndex   2967

Definition at line 58 of file toasting.h.

Referenced by IsSharedRelation().

#define PgDbRoleSettingToastTable   2966

Definition at line 57 of file toasting.h.

Referenced by IsSharedRelation().

#define PgShdescriptionToastIndex   2847

Definition at line 55 of file toasting.h.

Referenced by IsSharedRelation().

#define PgShdescriptionToastTable   2846

Definition at line 54 of file toasting.h.

Referenced by IsSharedRelation().


Function Documentation

void AlterTableCreateToastTable ( Oid  relOid,
Datum  reloptions 
)

Definition at line 56 of file toasting.c.

References AccessExclusiveLock, create_toast_table(), heap_close, heap_open(), InvalidOid, and NoLock.

Referenced by ATRewriteCatalogs(), intorel_startup(), make_new_heap(), and ProcessUtilitySlow().

{
    Relation    rel;

    /*
     * Grab an exclusive lock on the target table, since we'll update its
     * pg_class tuple. This is redundant for all present uses, since caller
     * will have such a lock already.  But the lock is needed to ensure that
     * concurrent readers of the pg_class tuple won't have visibility issues,
     * so let's be safe.
     */
    rel = heap_open(relOid, AccessExclusiveLock);

    /* create_toast_table does all the work */
    (void) create_toast_table(rel, InvalidOid, InvalidOid, reloptions);

    heap_close(rel, NoLock);
}

void BootstrapToastTable ( char *  relName,
Oid  toastOid,
Oid  toastIndexOid 
)

Definition at line 81 of file toasting.c.

References AccessExclusiveLock, create_toast_table(), elog, ereport, errcode(), errmsg(), ERROR, heap_close, heap_openrv(), makeRangeVar(), NoLock, NULL, RelationData::rd_rel, RELKIND_MATVIEW, and RELKIND_RELATION.

{
    Relation    rel;

    rel = heap_openrv(makeRangeVar(NULL, relName, -1), AccessExclusiveLock);

    if (rel->rd_rel->relkind != RELKIND_RELATION &&
        rel->rd_rel->relkind != RELKIND_MATVIEW)
        ereport(ERROR,
                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                 errmsg("\"%s\" is not a table or materialized view",
                        relName)));

    /* create_toast_table does all the work */
    if (!create_toast_table(rel, toastOid, toastIndexOid, (Datum) 0))
        elog(ERROR, "\"%s\" does not require a toast table",
             relName);

    heap_close(rel, NoLock);
}

DECLARE_TOAST ( pg_shdescription  ,
2846  ,
2847   
)
DECLARE_TOAST ( pg_trigger  ,
2336  ,
2337   
)
DECLARE_TOAST ( pg_statistic  ,
2840  ,
2841   
)
DECLARE_TOAST ( pg_seclabel  ,
3598  ,
3599   
)
DECLARE_TOAST ( pg_rewrite  ,
2838  ,
2839   
)
DECLARE_TOAST ( pg_proc  ,
2836  ,
2837   
)
DECLARE_TOAST ( pg_description  ,
2834  ,
2835   
)
DECLARE_TOAST ( pg_constraint  ,
2832  ,
2833   
)
DECLARE_TOAST ( pg_attrdef  ,
2830  ,
2831   
)
DECLARE_TOAST ( pg_db_role_setting  ,
2966  ,
2967   
)