Skip site navigation (1) Skip section navigation (2)

Re: Solution for bug #899

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Laurent FAILLIE <l_faillie(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Solution for bug #899
Date: 2003-03-20 20:03:51
Message-ID: 200303202003.h2KK3p908695@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
This patch can't be applied to CVS.  The pg_dump code has changed too
much since 7.3.X.   Would you supply a new patch for this?  Thanks.  You
can grab the current CVS or a snapshot from our ftp server.

Also, would you add a comment of how you are manipulating the ACL tags,
and its purpose.  Thanks.

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

Laurent FAILLIE wrote:
> 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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-bugs by date

Next:From: Robert E. BruccoleriDate: 2003-03-21 00:26:49
Subject: Bug report
Previous:From: abremondDate: 2003-03-20 17:51:58
Subject:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group