aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/copy.c
diff options
context:
space:
mode:
authorPostgreSQL Daemon <webmaster@postgresql.org>1998-01-15 19:46:37 +0000
committerPostgreSQL Daemon <webmaster@postgresql.org>1998-01-15 19:46:37 +0000
commitbaef78d96b799b6264a54f8cfce4fda2b2da9701 (patch)
treea842ceff78d7eba3de43ba866976d828cf6d2d34 /src/backend/commands/copy.c
parent763ff8aef848d71da079049890786edffc3302d6 (diff)
downloadpostgresql-baef78d96b799b6264a54f8cfce4fda2b2da9701.tar.gz
postgresql-baef78d96b799b6264a54f8cfce4fda2b2da9701.zip
Thank god for searchable mail archives.
Patch by: wieck@sapserv.debis.de (Jan Wieck) One of the design rules of PostgreSQL is extensibility. And to follow this rule means (at least for me) that there should not only be a builtin PL. Instead I would prefer a defined interface for PL implemetations.
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r--src/backend/commands/copy.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index ead927c34a6..9b5fbda69e8 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.37 1998/01/05 16:38:46 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.38 1998/01/15 19:42:36 pgsql Exp $
*
*-------------------------------------------------------------------------
*/
@@ -202,8 +202,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
int32 attr_count,
i;
AttributeTupleForm *attr;
- func_ptr *out_functions;
- int dummy;
+ FmgrInfo *out_functions;
Oid out_func_oid;
Oid *elements;
Datum value;
@@ -229,12 +228,12 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
if (!binary)
{
- out_functions = (func_ptr *) palloc(attr_count * sizeof(func_ptr));
+ out_functions = (FmgrInfo *) palloc(attr_count * sizeof(FmgrInfo));
elements = (Oid *) palloc(attr_count * sizeof(Oid));
for (i = 0; i < attr_count; i++)
{
out_func_oid = (Oid) GetOutputFunction(attr[i]->atttypid);
- fmgr_info(out_func_oid, &out_functions[i], &dummy);
+ fmgr_info(out_func_oid, &out_functions[i]);
elements[i] = GetTypeElement(attr[i]->atttypid);
}
nulls = NULL; /* meaningless, but compiler doesn't know
@@ -272,7 +271,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
{
if (!isnull)
{
- string = (char *) (out_functions[i]) (value, elements[i]);
+ string = (char *) (*fmgr_faddr(&out_functions[i])) (value, elements[i]);
CopyAttributeOut(fp, string, delim);
pfree(string);
}
@@ -357,9 +356,8 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
HeapTuple tuple;
AttrNumber attr_count;
AttributeTupleForm *attr;
- func_ptr *in_functions;
- int i,
- dummy;
+ FmgrInfo *in_functions;
+ int i;
Oid in_func_oid;
Datum *values;
char *nulls,
@@ -498,12 +496,12 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
if (!binary)
{
- in_functions = (func_ptr *) palloc(attr_count * sizeof(func_ptr));
+ in_functions = (FmgrInfo *) palloc(attr_count * sizeof(FmgrInfo));
elements = (Oid *) palloc(attr_count * sizeof(Oid));
for (i = 0; i < attr_count; i++)
{
in_func_oid = (Oid) GetInputFunction(attr[i]->atttypid);
- fmgr_info(in_func_oid, &in_functions[i], &dummy);
+ fmgr_info(in_func_oid, &in_functions[i]);
elements[i] = GetTypeElement(attr[i]->atttypid);
}
}
@@ -574,7 +572,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
else
{
values[i] =
- (Datum) (in_functions[i]) (string,
+ (Datum) (*fmgr_faddr(&in_functions[i])) (string,
elements[i],
attr[i]->attlen);