Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 837f0cb

Browse files
committed
CREATE FUNCTION fixup for types of functions.
1 parent 77d514a commit 837f0cb

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/bin/pg_dump/pg_dump.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.46 1997/09/24 15:14:02 momjian Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.47 1997/09/24 15:36:34 momjian Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -59,6 +59,7 @@
5959
#include "postgres.h"
6060
#include "access/htup.h"
6161
#include "catalog/pg_type.h"
62+
#include "catalog/pg_language.h"
6263
#include "catalog/pg_index.h"
6364
#include "libpq-fe.h"
6465
#ifndef HAVE_STRDUP
@@ -1238,7 +1239,7 @@ getFuncs(int *numFuncs)
12381239
finfo[i].prorettype = strdup(PQgetvalue(res, i, i_prorettype));
12391240
finfo[i].retset = (strcmp(PQgetvalue(res, i, i_proretset), "t") == 0);
12401241
finfo[i].nargs = atoi(PQgetvalue(res, i, i_pronargs));
1241-
finfo[i].lang = (atoi(PQgetvalue(res, i, i_prolang)) == C_PROLANG_OID);
1242+
finfo[i].lang = atoi(PQgetvalue(res, i, i_prolang));
12421243

12431244
finfo[i].usename = strdup(PQgetvalue(res, i, i_usename));
12441245

@@ -1717,8 +1718,12 @@ dumpOneFunc(FILE *fout, FuncInfo *finfo, int i,
17171718
q,
17181719
(finfo[i].retset) ? " SETOF " : "",
17191720
findTypeByOid(tinfo, numTypes, finfo[i].prorettype),
1720-
(finfo[i].lang) ? finfo[i].probin : finfo[i].prosrc,
1721-
(finfo[i].lang) ? "C" : "SQL");
1721+
(finfo[i].lang == INTERNALlanguageId) ? finfo[i].prosrc :
1722+
(finfo[i].lang == ClanguageId) ? finfo[i].probin :
1723+
(finfo[i].lang == SQLlanguageId) ? finfo[i].prosrc : "unknown");
1724+
(finfo[i].lang == INTERNALlanguageId) ? "INTERNAL" :
1725+
(finfo[i].lang == ClanguageId) ? "C" :
1726+
(finfo[i].lang == SQLlanguageId) ? "SQL" : "unknown");
17221727

17231728
fputs(q, fout);
17241729

src/bin/pg_dump/pg_dump.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: pg_dump.h,v 1.23 1997/09/08 21:49:59 momjian Exp $
8+
* $Id: pg_dump.h,v 1.24 1997/09/24 15:36:36 momjian Exp $
99
*
1010
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
1111
*
@@ -49,7 +49,7 @@ typedef struct _funcInfo
4949
char *oid;
5050
char *proname;
5151
char *proowner;
52-
int lang; /* 1 if C, else SQL */
52+
int lang;
5353
int nargs;
5454
char *argtypes[8]; /* should be derived from obj/fmgr.h
5555
* instead of hardwired */
@@ -232,6 +232,3 @@ dumpIndices(FILE *fout, IndInfo *indinfo, int numIndices,
232232

233233
/* largest query string size */
234234
#define MAXQUERYLEN 5000
235-
236-
/* these voodoo constants are from the backend */
237-
#define C_PROLANG_OID 13

0 commit comments

Comments
 (0)