aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/temprel.h
blob: b185e3372e90c2def6d1a3b372dec6784edf499f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*-------------------------------------------------------------------------
 *
 * temprel.h
 *	  Temporary relation functions
 *
 *
 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * $Id: temprel.h,v 1.16 2001/06/18 16:13:21 momjian Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef TEMPREL_H
#define TEMPREL_H

#include "access/htup.h"

#define PG_TEMP_REL_PREFIX "pg_temp"

#define is_temp_relname(relname) \
		(strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)) == 0)

extern void create_temp_relation(const char *relname,
					 HeapTuple pg_class_tuple);
extern void remove_temp_rel_by_relid(Oid relid);
extern bool rename_temp_relation(const char *oldname,
					 const char *newname);

extern void remove_all_temp_relations(void);
extern void AtEOXact_temp_relations(bool isCommit);

extern char *get_temp_rel_by_username(const char *user_relname);
extern char *get_temp_rel_by_physicalname(const char *relname);

#define is_temp_rel_name(relname) (get_temp_rel_by_username(relname) != NULL)

#endif	 /* TEMPREL_H */