PostgreSQL Source Code git master
parse_type.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * parse_type.h
4 * handle type operations for parser
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/parser/parse_type.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef PARSE_TYPE_H
14#define PARSE_TYPE_H
15
16#include "access/htup.h"
17#include "parser/parse_node.h"
18
19
21
22extern Type LookupTypeName(ParseState *pstate, const TypeName *typeName,
23 int32 *typmod_p, bool missing_ok);
25 const TypeName *typeName, int32 *typmod_p,
26 bool temp_ok, bool missing_ok);
27extern Oid LookupTypeNameOid(ParseState *pstate, const TypeName *typeName,
28 bool missing_ok);
29extern Type typenameType(ParseState *pstate, const TypeName *typeName,
30 int32 *typmod_p);
31extern Oid typenameTypeId(ParseState *pstate, const TypeName *typeName);
32extern void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName,
33 Oid *typeid_p, int32 *typmod_p);
34
35extern char *TypeNameToString(const TypeName *typeName);
37
38extern Oid LookupCollation(ParseState *pstate, List *collnames, int location);
39extern Oid GetColumnDefCollation(ParseState *pstate, const ColumnDef *coldef, Oid typeOid);
40
41extern Type typeidType(Oid id);
42
43extern Oid typeTypeId(Type tp);
44extern int16 typeLen(Type t);
45extern bool typeByVal(Type t);
46extern char *typeTypeName(Type t);
47extern Oid typeTypeRelid(Type typ);
48extern Oid typeTypeCollation(Type typ);
49extern Datum stringTypeDatum(Type tp, char *string, int32 atttypmod);
50
51extern Oid typeidTypeRelid(Oid type_id);
52extern Oid typeOrDomainTypeRelid(Oid type_id);
53
54extern TypeName *typeStringToTypeName(const char *str, Node *escontext);
55extern bool parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p,
56 Node *escontext);
57
58/* true if typeid is composite, or domain over composite, but not RECORD */
59#define ISCOMPLEX(typeid) (typeOrDomainTypeRelid(typeid) != InvalidOid)
60
61#endif /* PARSE_TYPE_H */
int16_t int16
Definition: c.h:497
int32_t int32
Definition: c.h:498
const char * str
const char ** typenames
Definition: lexi.c:115
Oid typeTypeRelid(Type typ)
Definition: parse_type.c:630
Oid typeOrDomainTypeRelid(Oid type_id)
Definition: parse_type.c:689
HeapTuple Type
Definition: parse_type.h:20
Type typeidType(Oid id)
Definition: parse_type.c:578
Oid LookupCollation(ParseState *pstate, List *collnames, int location)
Definition: parse_type.c:515
Type LookupTypeNameExtended(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool temp_ok, bool missing_ok)
Definition: parse_type.c:73
char * TypeNameToString(const TypeName *typeName)
Definition: parse_type.c:478
Oid typeTypeCollation(Type typ)
Definition: parse_type.c:640
void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName, Oid *typeid_p, int32 *typmod_p)
Definition: parse_type.c:310
bool parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p, Node *escontext)
Definition: parse_type.c:785
Type LookupTypeName(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool missing_ok)
Definition: parse_type.c:38
Oid typeidTypeRelid(Oid type_id)
Definition: parse_type.c:668
char * typeTypeName(Type t)
Definition: parse_type.c:619
Datum stringTypeDatum(Type tp, char *string, int32 atttypmod)
Definition: parse_type.c:654
Type typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
Definition: parse_type.c:264
bool typeByVal(Type t)
Definition: parse_type.c:609
char * TypeNameListToString(List *typenames)
Definition: parse_type.c:492
TypeName * typeStringToTypeName(const char *str, Node *escontext)
Definition: parse_type.c:738
Oid GetColumnDefCollation(ParseState *pstate, const ColumnDef *coldef, Oid typeOid)
Definition: parse_type.c:540
Oid typeTypeId(Type tp)
Definition: parse_type.c:590
Oid typenameTypeId(ParseState *pstate, const TypeName *typeName)
Definition: parse_type.c:291
int16 typeLen(Type t)
Definition: parse_type.c:599
Oid LookupTypeNameOid(ParseState *pstate, const TypeName *typeName, bool missing_ok)
Definition: parse_type.c:232
uintptr_t Datum
Definition: postgres.h:69
unsigned int Oid
Definition: postgres_ext.h:32
Definition: pg_list.h:54
Definition: nodes.h:131