Re: Solution for bug #899 - Mailing list pgsql-bugs
| From | Laurent FAILLIE |
|---|---|
| Subject | Re: Solution for bug #899 |
| Date | |
| Msg-id | 20030307220531.14354.qmail@web13503.mail.yahoo.com Whole thread Raw |
| In response to | Re: Solution for bug #899 (Bruce Momjian <pgman@candle.pha.pa.us>) |
| List | pgsql-bugs |
--- Bruce Momjian <pgman@candle.pha.pa.us> a écrit :
>
> Can I get a context diff (diff -c) of this?
Ok, but you have to wait 'till end of next week
because I'm on hollidays (SSSskkkkkkiiiii :-)))) ).
> What
> exactly did you
> change and why?
Ok, some explanations :
> > 603a604,606
> > > MoveToStart(g_fout, "ACL LANGUAGE");
> > > MoveToStart(g_fout, "PROCEDURAL LANGUAGE");
> > > MoveToStart(g_fout, "FUNC PROCEDURAL
> LANGUAGE");
-> Move all Languages stuffs in the beggining of the
listing, juste after database creation. In order :
- handler of the language,
- language declaration,
- ACL for them.
> > 3522c3525
> > < dumpACL(fout, "LANGUAGE", tmp, lanname,
> > ---
> > > dumpACL(fout, "ACL LANGUAGE", tmp, lanname,
-> it's not a "normal" ACL, but it's for procedural
language. We need to have a specific signature, "ACL
LANGUAGE", to make differences w/ other ACL.
> > 3526a3530,3531
> > >
> > >
> > 3627a3633
> > > char *funcproclang;
> > 3643c3649,3650
> > < "(SELECT lanname FROM
> pg_catalog.pg_language
> > WHERE oid = prolang) as lanname "
> > ---
> > > "(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 "
> > 3655c3662,3663
> > < "(SELECT lanname FROM pg_language WHERE
> oid
> > = prolang) as lanname "
> > ---
> > > "(SELECT lanname FROM pg_language WHERE
> oid
> > = prolang) as lanname, "
> > > "exists (SELECT 'x' FROM pg_language
> WHERE
> > lanplcallfoid = pg_proc.oid) as funcproclang "
> > 3667c3675,3676
> > < "(SELECT lanname FROM pg_language WHERE
> oid
> > = prolang) as lanname "
> > ---
> > > "(SELECT lanname FROM pg_language WHERE
> oid
> > = prolang) as lanname, "
> > > "exists (SELECT 'x' FROM pg_language
> WHERE
> > lanplcallfoid = pg_proc.oid) as funcproclang "
> > 3697a3707
> > > funcproclang = PQgetvalue(res, 0,
> PQfnumber(res,
> > "funcproclang"));
> > 3768c3778
=> add a new flags, funcproclang, which is true only
if the record is for an handler for procedural
language.
> > < finfo->usename, "FUNCTION", NULL,
> > ---
> > > finfo->usename,
> > strcmp(funcproclang,"t")?"FUNCTION":"FUNC
> PROCEDURAL
> > LANGUAGE", NULL,
=> Change the signature for handler, according to
funcproclang.
> > 4874a4885,4886
> > > char acl_lang=0;
> > >
> > 4877a4890,4894
> > > if(!strcmp(type,"ACL LANGUAGE")){
> > > type = "LANGUAGE";
> > > acl_lang = 1;
> > > }
> > >
> > 4992c5009
> > < "ACL", NULL, sql->data, "", NULL, NULL,
> NULL);
> > ---
> > > acl_lang ? "ACL LANGUAGE" : "ACL", NULL,
> > sql->data, "", NULL, NULL, NULL);
=> We have changed the signature of language ACL. But,
dumpACL()'s code use this signature to build requests
to take informations inside the database, and,
obviously, it doesn't work w/ my new one.
So, my solution was to use a flag, acl_lang, about
dumping language ACL, and reset type to the standard
"LANGUAGE".
The last step is to store ACL w/ the right signature
according to this flag ...
That's all, I hope my poor english will be
understandable ;-D
Bye
Laurent
=====
The misspelling master is on the Web. _________ 100 % Dictionnary Free ! / /(/ Dico / / Pleins d'autres
fautessur
/________/ / 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
pgsql-bugs by date: