aboutsummaryrefslogtreecommitdiff
path: root/contrib/tablefunc/tablefunc.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2010-11-20 10:04:48 -0500
committerRobert Haas <rhaas@postgresql.org>2010-11-20 10:04:48 -0500
commit4343c0e546b216ab38a3397a4f0f7476d557b352 (patch)
tree5a5676ac12ebe9f480851e2bb963ac1418c86921 /contrib/tablefunc/tablefunc.c
parente8bf683fbee935181e207d7171630194ed01f6a1 (diff)
downloadpostgresql-4343c0e546b216ab38a3397a4f0f7476d557b352.tar.gz
postgresql-4343c0e546b216ab38a3397a4f0f7476d557b352.zip
Expose quote_literal_cstr() from core.
This eliminates the need for inefficient implementions of this functionality in both contrib/dblink and contrib/tablefunc, so remove them. The upcoming patch implementing an in-core format() function will also require this functionality. In passing, add some regression tests.
Diffstat (limited to 'contrib/tablefunc/tablefunc.c')
-rw-r--r--contrib/tablefunc/tablefunc.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c
index ea2f2e15b0a..2e9ea1a626e 100644
--- a/contrib/tablefunc/tablefunc.c
+++ b/contrib/tablefunc/tablefunc.c
@@ -85,7 +85,6 @@ static Tuplestorestate *build_tuplestore_recursively(char *key_fld,
MemoryContext per_query_ctx,
AttInMetadata *attinmeta,
Tuplestorestate *tupstore);
-static char *quote_literal_cstr(char *rawstr);
typedef struct
{
@@ -1564,22 +1563,3 @@ compatCrosstabTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdesc)
/* OK, the two tupdescs are compatible for our purposes */
return true;
}
-
-/*
- * Return a properly quoted literal value.
- * Uses quote_literal in quote.c
- */
-static char *
-quote_literal_cstr(char *rawstr)
-{
- text *rawstr_text;
- text *result_text;
- char *result;
-
- rawstr_text = cstring_to_text(rawstr);
- result_text = DatumGetTextP(DirectFunctionCall1(quote_literal,
- PointerGetDatum(rawstr_text)));
- result = text_to_cstring(result_text);
-
- return result;
-}