Header And Logo

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

parse_type.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * parse_type.h
00004  *      handle type operations for parser
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * src/include/parser/parse_type.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef PARSE_TYPE_H
00014 #define PARSE_TYPE_H
00015 
00016 #include "access/htup.h"
00017 #include "parser/parse_node.h"
00018 
00019 
00020 typedef HeapTuple Type;
00021 
00022 extern Type LookupTypeName(ParseState *pstate, const TypeName *typeName,
00023                int32 *typmod_p);
00024 extern Type typenameType(ParseState *pstate, const TypeName *typeName,
00025              int32 *typmod_p);
00026 extern Oid  typenameTypeId(ParseState *pstate, const TypeName *typeName);
00027 extern void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName,
00028                      Oid *typeid_p, int32 *typmod_p);
00029 
00030 extern char *TypeNameToString(const TypeName *typeName);
00031 extern char *TypeNameListToString(List *typenames);
00032 
00033 extern Oid  LookupCollation(ParseState *pstate, List *collnames, int location);
00034 extern Oid  GetColumnDefCollation(ParseState *pstate, ColumnDef *coldef, Oid typeOid);
00035 
00036 extern Type typeidType(Oid id);
00037 
00038 extern Oid  typeTypeId(Type tp);
00039 extern int16 typeLen(Type t);
00040 extern bool typeByVal(Type t);
00041 extern char *typeTypeName(Type t);
00042 extern Oid  typeTypeRelid(Type typ);
00043 extern Oid  typeTypeCollation(Type typ);
00044 extern Datum stringTypeDatum(Type tp, char *string, int32 atttypmod);
00045 
00046 extern Oid  typeidTypeRelid(Oid type_id);
00047 
00048 extern void parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p);
00049 
00050 #define ISCOMPLEX(typeid) (typeidTypeRelid(typeid) != InvalidOid)
00051 
00052 #endif   /* PARSE_TYPE_H */