1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00
2 remove select qeury in inserts
This commit is contained in:
Teodor Sigaev
2004-05-31 16:51:56 +00:00
parent 7cb55d21ed
commit 553bc41633
11 changed files with 231 additions and 111 deletions

View File

@@ -13,7 +13,12 @@
static int
compareSNMapEntry(const void *a, const void *b)
{
return strcmp(((SNMapEntry *) a)->key, ((SNMapEntry *) b)->key);
if ( ((SNMapEntry *) a)->nsp < ((SNMapEntry *) b)->nsp )
return -1;
else if ( ((SNMapEntry *) a)->nsp > ((SNMapEntry *) b)->nsp )
return 1;
else
return strcmp(((SNMapEntry *) a)->key, ((SNMapEntry *) b)->key);
}
void
@@ -37,6 +42,7 @@ addSNMap(SNMap * map, char *key, Oid value)
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
map->list[map->len].nsp = get_oidnamespace(TSNSP_FunctionOid);
map->list[map->len].value = value;
map->len++;
if (map->len > 1)
@@ -59,6 +65,7 @@ findSNMap(SNMap * map, char *key)
SNMapEntry ks;
ks.key = key;
ks.nsp = get_oidnamespace(TSNSP_FunctionOid);
ks.value = 0;
if (map->len == 0 || !map->list)