From 1f1c332381fdc3927c99478a01d47aea4c5b0f10 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 23 Nov 2002 01:54:09 +0000 Subject: Remove inappropriate double-quoting in connectby() code; adjust regression test to avoid using VALUE as a name. From Joe Conway. --- contrib/tablefunc/tablefunc.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'contrib/tablefunc/tablefunc.c') 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; -} -- cgit v1.2.3