Re: Solution for bug #899

From: Laurent FAILLIE <l_faillie(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Solution for bug #899
Date: 2003-03-13 16:04:14
Message-ID: 20030313160414.3725.qmail@web13506.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ok there is the context diff of my modification :

Bye

Laurent

-------------------

*** postgresql-7.3.2/src/bin/pg_dump/pg_dump.c Fri Dec
27 18:10:55 2002
--- postgresql-7.3.2/src/bin/pg_dump/pg_dump.c.new Wed
Mar 5 12:12:32 2003
***************
*** 601,606 ****
--- 601,609 ----

/* Now sort the output nicely */
SortTocByOID(g_fout);
+ MoveToStart(g_fout, "ACL LANGUAGE");
+ MoveToStart(g_fout, "PROCEDURAL LANGUAGE");
+ MoveToStart(g_fout, "FUNC PROCEDURAL LANGUAGE");
MoveToStart(g_fout, "SCHEMA");
MoveToStart(g_fout, "DATABASE");
MoveToEnd(g_fout, "TABLE DATA");
***************
*** 3519,3529 ****
{
char *tmp = strdup(fmtId(lanname));

! dumpACL(fout, "LANGUAGE", tmp, lanname,
finfo[fidx].pronamespace->nspname,
NULL, lanacl, lanoid);
free(tmp);
}
}

PQclear(res);
--- 3522,3534 ----
{
char *tmp = strdup(fmtId(lanname));

! dumpACL(fout, "ACL LANGUAGE", tmp, lanname,
finfo[fidx].pronamespace->nspname,
NULL, lanacl, lanoid);
free(tmp);
}
+
+
}

PQclear(res);
***************
*** 3625,3630 ****
--- 3630,3636 ----
char *prosecdef;
char *lanname;
char *rettypename;
+ char *funcproclang;

if (finfo->dumped)
goto done;
***************
*** 3640,3646 ****
appendPQExpBuffer(query,
"SELECT proretset, prosrc, probin, "
"provolatile, proisstrict, prosecdef, "
! "(SELECT lanname FROM pg_catalog.pg_language
WHERE oid = prolang) as lanname "
"FROM pg_catalog.pg_proc "
"WHERE oid = '%s'::pg_catalog.oid",
finfo->oid);
--- 3646,3653 ----
appendPQExpBuffer(query,
"SELECT proretset, prosrc, probin, "
"provolatile, proisstrict, prosecdef, "
! "(SELECT lanname FROM pg_catalog.pg_language
WHERE oid = prolang) as lanname, "
! "exists (SELECT 'x' FROM
pg_catalog.pg_language WHERE lanplcallfoid =
pg_catalog.pg_proc.oid) as funcproclang "
"FROM pg_catalog.pg_proc "
"WHERE oid = '%s'::pg_catalog.oid",
finfo->oid);
***************
*** 3652,3658 ****
"case when proiscachable then 'i' else 'v' end as
provolatile, "
"proisstrict, "
"'f'::boolean as prosecdef, "
! "(SELECT lanname FROM pg_language WHERE oid
= prolang) as lanname "
"FROM pg_proc "
"WHERE oid = '%s'::oid",
finfo->oid);
--- 3659,3666 ----
"case when proiscachable then 'i' else 'v' end as
provolatile, "
"proisstrict, "
"'f'::boolean as prosecdef, "
! "(SELECT lanname FROM pg_language WHERE oid
= prolang) as lanname, "
! "exists (SELECT 'x' FROM pg_language WHERE
lanplcallfoid = pg_proc.oid) as funcproclang "
"FROM pg_proc "
"WHERE oid = '%s'::oid",
finfo->oid);
***************
*** 3664,3670 ****
"case when proiscachable then 'i' else 'v' end as
provolatile, "
"'f'::boolean as proisstrict, "
"'f'::boolean as prosecdef, "
! "(SELECT lanname FROM pg_language WHERE oid
= prolang) as lanname "
"FROM pg_proc "
"WHERE oid = '%s'::oid",
finfo->oid);
--- 3672,3679 ----
"case when proiscachable then 'i' else 'v' end as
provolatile, "
"'f'::boolean as proisstrict, "
"'f'::boolean as prosecdef, "
! "(SELECT lanname FROM pg_language WHERE oid
= prolang) as lanname, "
! "exists (SELECT 'x' FROM pg_language WHERE
lanplcallfoid = pg_proc.oid) as funcproclang "
"FROM pg_proc "
"WHERE oid = '%s'::oid",
finfo->oid);
***************
*** 3695,3700 ****
--- 3704,3710 ----
proisstrict = PQgetvalue(res, 0, PQfnumber(res,
"proisstrict"));
prosecdef = PQgetvalue(res, 0, PQfnumber(res,
"prosecdef"));
lanname = PQgetvalue(res, 0, PQfnumber(res,
"lanname"));
+ funcproclang = PQgetvalue(res, 0, PQfnumber(res,
"funcproclang"));

/*
* See backend/commands/define.c for details of how
the 'AS' clause is
***************
*** 3765,3771 ****

ArchiveEntry(fout, finfo->oid, funcsig_tag,
finfo->pronamespace->nspname,
! finfo->usename, "FUNCTION", NULL,
q->data, delqry->data,
NULL, NULL, NULL);

--- 3775,3781 ----

ArchiveEntry(fout, finfo->oid, funcsig_tag,
finfo->pronamespace->nspname,
! finfo->usename,
strcmp(funcproclang,"t")?"FUNCTION":"FUNC PROCEDURAL
LANGUAGE", NULL,
q->data, delqry->data,
NULL, NULL, NULL);

***************
*** 4872,4880 ****
--- 4882,4897 ----
*tok,
*eqpos,
*priv;
+ char acl_lang=0;
+
PQExpBuffer sql;
bool found_owner_privs = false;

+ if(!strcmp(type,"ACL LANGUAGE")){
+ type = "LANGUAGE";
+ acl_lang = 1;
+ }
+
if (strlen(acls) == 0)
return; /* object has default permissions */

***************
*** 4989,4995 ****
}

ArchiveEntry(fout, objoid, tag, nspname, usename ?
usename : "",
! "ACL", NULL, sql->data, "", NULL, NULL, NULL);

free(aclbuf);
destroyPQExpBuffer(sql);
--- 5006,5012 ----
}

ArchiveEntry(fout, objoid, tag, nspname, usename ?
usename : "",
! acl_lang ? "ACL LANGUAGE" : "ACL", NULL,
sql->data, "", NULL, NULL, NULL);

free(aclbuf);
destroyPQExpBuffer(sql);

=====
The misspelling master is on the Web.
_________ 100 % Dictionnary Free !
/ /(
/ Dico / / Pleins d'autres fautes sur
/________/ / http://go.to/destroyedlolo
(#######( / http://destroyedlolo.homeunix.org:8080
Quoi, des fautes d'orthographe! Pas possible ;-D.

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Donald Fraser 2003-03-13 17:57:39 Transactions and RowExclusive locks on foreign key tables
Previous Message Tom Lane 2003-03-13 15:36:19 Re: Optimizer bug in subselect/view