46#include "utils/fmgroids.h"
115 elog(
ERROR,
"unrecognized attribute for text search parser: %d",
124 errmsg(
"function %s should return type %s",
200 errmsg(
"must be superuser to create text search parsers")));
209 memset(nulls,
false,
sizeof(nulls));
221 foreach(
pl, parameters)
253 errmsg(
"text search parser parameter \"%s\" not recognized",
263 errmsg(
"text search parser start method is required")));
268 errmsg(
"text search parser gettoken method is required")));
273 errmsg(
"text search parser end method is required")));
278 errmsg(
"text search parser lextypes method is required")));
360 elog(
ERROR,
"cache lookup failed for text search template %u",
372 errmsg(
"text search template \"%s\" does not accept options",
425 foreach(
pl, parameters)
446 errmsg(
"text search template is required")));
457 memset(nulls,
false,
sizeof(nulls));
515 elog(
ERROR,
"cache lookup failed for text search dictionary %u",
535 foreach(
pl,
stmt->options)
632 elog(
ERROR,
"unrecognized attribute for text search template: %d",
641 errmsg(
"function %s should return type %s",
707 errmsg(
"must be superuser to create text search templates")));
730 foreach(
pl, parameters)
749 errmsg(
"text search template parameter \"%s\" not recognized",
759 errmsg(
"text search template lexize method is required")));
799 elog(
ERROR,
"cache lookup failed for text search configuration %u",
821 myself.objectId = cfg->oid;
928 foreach(
pl, parameters)
939 errmsg(
"text search configuration parameter \"%s\" not recognized",
946 errmsg(
"cannot specify both PARSER and COPY options")));
965 elog(
ERROR,
"cache lookup failed for text search configuration %u",
982 errmsg(
"text search parser is required")));
990 memset(nulls,
false,
sizeof(nulls));
1122 elog(
ERROR,
"cache lookup failed for text search dictionary %u",
1168 errmsg(
"text search configuration \"%s\" does not exist",
1183 else if (
stmt->tokentype)
1242 elog(
ERROR,
"method lextype isn't defined for text search parser %u",
1260 while (list && list[
j].lexid)
1266 ts->
num = list[
j].lexid;
1277 errmsg(
"token type \"%s\" does not exist",
1308 prsId =
tsform->cfgparser;
1349 foreach(
c,
stmt->dicts)
1436 for (
i = 0;
i < nslots;
i++)
1452 slot[
slotCount]->tts_tupleDescriptor->natts *
sizeof(
bool));
1477 for (
i = 0;
i < nslots;
i++)
1505 prsId =
tsform->cfgparser;
1536 if (!
stmt->missing_ok)
1540 errmsg(
"mapping for token type \"%s\" does not exist",
1546 (
errmsg(
"mapping for token type \"%s\" does not exist, skipping",
1647 for (; ptr < endptr; ptr++)
1652 if (
isspace((
unsigned char) *ptr) || *ptr ==
',')
1667 if (
isspace((
unsigned char) *ptr))
1672 else if (*ptr ==
'=')
1685 if (ptr + 1 < endptr && ptr[1] ==
'"')
1704 else if (!
isspace((
unsigned char) *ptr))
1707 errmsg(
"invalid parameter list format: \"%s\"",
1716 else if (*ptr ==
'E' && ptr + 1 < endptr && ptr[1] ==
'\'')
1722 else if (*ptr ==
'"')
1727 else if (!
isspace((
unsigned char) *ptr))
1737 if (ptr + 1 < endptr && ptr[1] ==
'\'')
1752 else if (*ptr ==
'\\')
1754 if (ptr + 1 < endptr && ptr[1] ==
'\\')
1770 if (ptr + 1 < endptr && ptr[1] ==
'"')
1791 if (*ptr ==
',' ||
isspace((
unsigned char) *ptr))
1806 elog(
ERROR,
"unrecognized deserialize_deflist state: %d",
1822 errmsg(
"invalid parameter list format: \"%s\"",
1845 if (
errno == 0 && *endptr ==
'\0')
1852 if (
errno == 0 && *endptr ==
'\0')
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
static Datum values[MAXATTR]
#define ESCAPE_STRING_SYNTAX
#define SQL_STR_DOUBLE(ch, escape_backslash)
#define OidIsValid(objectId)
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
char * defGetString(DefElem *def)
List * defGetQualifiedName(DefElem *def)
void record_object_address_dependencies(const ObjectAddress *depender, ObjectAddresses *referenced, DependencyType behavior)
void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs)
ObjectAddresses * new_object_addresses(void)
void free_object_addresses(ObjectAddresses *addrs)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void EventTriggerCollectAlterTSConfig(AlterTSConfigurationStmt *stmt, Oid cfgId, Oid *dictIds, int ndicts)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
const TupleTableSlotOps TTSOpsHeapTuple
#define palloc_array(type, count)
#define palloc0_object(type)
#define OidFunctionCall1(functionId, arg1)
#define DatumGetTextPP(X)
void systable_endscan(SysScanDesc sysscan)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, const Datum *replValues, const bool *replIsnull, const bool *doReplace)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void heap_freetuple(HeapTuple htup)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
void CatalogTuplesMultiInsertWithInfo(Relation heapRel, TupleTableSlot **slot, int ntuples, CatalogIndexState indstate)
void CatalogTupleUpdateWithInfo(Relation heapRel, const ItemPointerData *otid, HeapTuple tup, CatalogIndexState indstate)
void CatalogTupleUpdate(Relation heapRel, const ItemPointerData *otid, HeapTuple tup)
void CatalogCloseIndexes(CatalogIndexState indstate)
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
CatalogIndexState CatalogOpenIndexes(Relation heapRel)
void CatalogTupleDelete(Relation heapRel, const ItemPointerData *tid)
#define MAX_CATALOG_MULTI_INSERT_BYTES
List * lappend(List *list, void *datum)
char * get_namespace_name(Oid nspid)
Oid get_func_rettype(Oid funcid)
DefElem * makeDefElem(char *name, Node *arg, int location)
char * pstrdup(const char *in)
void pfree(void *pointer)
void namestrcpy(Name name, const char *str)
char * NameListToString(const List *names)
Oid QualifiedNameGetCreationNamespace(const List *names, char **objname_p)
Oid get_ts_dict_oid(List *names, bool missing_ok)
Oid get_ts_parser_oid(List *names, bool missing_ok)
Oid get_ts_config_oid(List *names, bool missing_ok)
Oid get_ts_template_oid(List *names, bool missing_ok)
#define IsA(nodeptr, _type_)
#define InvokeObjectPostCreateHook(classId, objectId, subId)
#define InvokeObjectPostAlterHook(classId, objectId, subId)
#define ObjectAddressSet(addr, class_id, object_id)
const char * func_signature_string(List *funcname, int nargs, List *argnames, const Oid *argtypes)
Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool missing_ok)
long deleteDependencyRecordsFor(Oid classId, Oid objectId, bool skipExtensionDeps)
void recordDependencyOnCurrentExtension(const ObjectAddress *object, bool isReplace)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define foreach_delete_current(lst, var_or_cell)
static ListCell * lnext(const List *l, const ListCell *c)
void deleteSharedDependencyRecordsFor(Oid classId, Oid objectId, int32 objectSubId)
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
static char buf[DEFAULT_XLOG_SEG_SIZE]
FormData_pg_ts_config * Form_pg_ts_config
FormData_pg_ts_config_map * Form_pg_ts_config_map
FormData_pg_ts_config_map
FormData_pg_ts_dict * Form_pg_ts_dict
FormData_pg_ts_parser * Form_pg_ts_parser
FormData_pg_ts_template * Form_pg_ts_template
static Datum PointerGetDatum(const void *X)
static Oid DatumGetObjectId(Datum X)
static Datum ObjectIdGetDatum(Oid X)
static Datum NameGetDatum(const NameData *X)
static Pointer DatumGetPointer(Datum X)
static Datum Int32GetDatum(int32 X)
#define RelationGetDescr(relation)
const char * quote_identifier(const char *ident)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
#define BTEqualStrategyNumber
int strtoint(const char *pg_restrict str, char **pg_restrict endptr, int base)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
TSParserCacheEntry * lookup_ts_parser_cache(Oid prsId)
ObjectAddress AlterTSConfiguration(AlterTSConfigurationStmt *stmt)
List * deserialize_deflist(Datum txt)
ObjectAddress DefineTSTemplate(List *names, List *parameters)
ObjectAddress DefineTSDictionary(List *names, List *parameters)
static ObjectAddress makeTSTemplateDependencies(HeapTuple tuple)
static ObjectAddress makeConfigurationDependencies(HeapTuple tuple, bool removeOld, Relation mapRel)
text * serialize_deflist(List *deflist)
void RemoveTSConfigurationById(Oid cfgId)
static HeapTuple GetTSConfigTuple(List *names)
static DefElem * buildDefItem(const char *name, const char *val, bool was_quoted)
static void DropConfigurationMapping(AlterTSConfigurationStmt *stmt, HeapTuple tup, Relation relMap)
static ObjectAddress makeDictionaryDependencies(HeapTuple tuple)
static Datum get_ts_template_func(DefElem *defel, int attnum)
static bool tstoken_list_member(char *token_name, List *tokens)
ObjectAddress DefineTSConfiguration(List *names, List *parameters, ObjectAddress *copied)
static Datum get_ts_parser_func(DefElem *defel, int attnum)
ObjectAddress AlterTSDictionary(AlterTSDictionaryStmt *stmt)
static void verify_dictoptions(Oid tmplId, List *dictoptions)
ObjectAddress DefineTSParser(List *names, List *parameters)
static void MakeConfigurationMapping(AlterTSConfigurationStmt *stmt, HeapTuple tup, Relation relMap)
static ObjectAddress makeParserDependencies(HeapTuple tuple)
static List * getTokenTypes(Oid prsId, List *tokennames)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Integer * makeInteger(int i)
String * makeString(char *str)
Float * makeFloat(char *numericStr)
Boolean * makeBoolean(bool val)
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
text * cstring_to_text_with_len(const char *s, int len)
char * text_to_cstring(const text *t)
void CommandCounterIncrement(void)