stringinfo_test.tar.bz2

application/octet-stream

Filename: stringinfo_test.tar.bz2
Type: application/octet-stream
Part: 0
Message: Re: Proposal: add new API to stringinfo
stringinfo_test/0000775000175000017500000000000014737146205014010 5ustar  t-ishiit-ishiistringinfo_test/stringinfo_test.control0000664000175000017500000000021414737113000020613 0ustar  t-ishiit-ishiicomment = 'function for benchmarking makeStringInfo'
default_version = '1.0'
module_pathname = '$libdir/stringinfo_test'
relocatable = true
stringinfo_test/stringinfo_test.c0000664000175000017500000000050414737142423017372 0ustar  t-ishiit-ishii/* -*-pgsql-c-*- */

#include "postgres.h"
#include "funcapi.h"

PG_MODULE_MAGIC;

PG_FUNCTION_INFO_V1(stringinfo_test);

Datum
stringinfo_test(PG_FUNCTION_ARGS)
{
	StringInfo	s;
	int		n;
	int		i;

	n = PG_GETARG_INT32(0);

	for (i = 0; i < n; i++)
	{
		s = makeStringInfo();
		destroyStringInfo(s);
	}
	PG_RETURN_VOID();
}
stringinfo_test/Makefile0000664000175000017500000000057514737136014015454 0ustar  t-ishiit-ishiiMODULE_big	= stringinfo_test
OBJS = \
	$(WIN32RES) \
	stringinfo_test.o
EXTENSION = stringinfo_test
DATA = stringinfo_test--1.0.sql

ifdef USE_PGXS
PG_CONFIG ?= pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/stringinfo_test
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
stringinfo_test/stringinfo_test--1.0.sql0000664000175000017500000000041514737113337020323 0ustar  t-ishiit-ishii-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION stringinfo_test" to load this file. \quit

CREATE FUNCTION stringinfo_test(IN niteration int)
RETURNS void
AS 'MODULE_PATHNAME', 'stringinfo_test'
LANGUAGE C STRICT;