diff options
author | Tom Lane | 2002-11-23 01:54:09 +0000 |
---|---|---|
committer | Tom Lane | 2002-11-23 01:54:09 +0000 |
commit | 1f1c332381fdc3927c99478a01d47aea4c5b0f10 (patch) | |
tree | 29654a2d19ac0c1d92e66f29d1b7221ada79a949 /contrib/tablefunc/tablefunc.c | |
parent | e760d22391635d550afcf41799411c04f20fd031 (diff) |
Remove inappropriate double-quoting in connectby() code; adjust
regression test to avoid using VALUE as a name. From Joe Conway.
Diffstat (limited to 'contrib/tablefunc/tablefunc.c')
-rw-r--r-- | contrib/tablefunc/tablefunc.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c index 6ea1e72b681..d5db3ceed73 100644 --- a/contrib/tablefunc/tablefunc.c +++ b/contrib/tablefunc/tablefunc.c @@ -66,7 +66,6 @@ static Tuplestorestate *build_tuplestore_recursively(char *key_fld, MemoryContext per_query_ctx, AttInMetadata *attinmeta, Tuplestorestate *tupstore); -static char *quote_ident_cstr(char *rawstr); typedef struct { @@ -776,12 +775,12 @@ build_tuplestore_recursively(char *key_fld, /* Build initial sql statement */ appendStringInfo(sql, "SELECT %s, %s FROM %s WHERE %s = '%s' AND %s IS NOT NULL", - quote_ident_cstr(key_fld), - quote_ident_cstr(parent_key_fld), - quote_ident_cstr(relname), - quote_ident_cstr(parent_key_fld), + key_fld, + parent_key_fld, + relname, + parent_key_fld, start_with, - quote_ident_cstr(key_fld)); + key_fld); /* Retrieve the desired rows */ ret = SPI_exec(sql->data, 0); @@ -1083,21 +1082,3 @@ make_crosstab_tupledesc(TupleDesc spi_tupdesc, int num_catagories) return tupdesc; } - -/* - * Return a properly quoted identifier. - * Uses quote_ident in quote.c - */ -static char * -quote_ident_cstr(char *rawstr) -{ - text *rawstr_text; - text *result_text; - char *result; - - rawstr_text = DatumGetTextP(DirectFunctionCall1(textin, CStringGetDatum(rawstr))); - result_text = DatumGetTextP(DirectFunctionCall1(quote_ident, PointerGetDatum(rawstr_text))); - result = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(result_text))); - - return result; -} |