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

Hard-coded PUBLIC in pg_dump

From: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 01:45:46
Message-ID: Pine.GSO.4.10.10212010328110.26370-100000@prana (view raw or flat)
Thread:
Lists: pgsql-advocacypgsql-generalpgsql-hackers
src/bin/pg_dump/pg_dump.c happen to have hard-coded PUBLIC role name.
It completly breaks dumps when run with Turksh locale setting. In my
opinion making it lower-case would do much good and no harm. A mini
patch is given below.

On the other hand, I was thinking about wrapping all the identifiers in
dump files in single quotes. It is done in "SET SESSION AUTHORIZATION"
clause. Is there a reason for not doing this with table and colum names?

Regards,
Nic



 

*** ./src/bin/pg_dump/pg_dump.c.orig	Sun Dec  1 03:23:56 2002
--- ./src/bin/pg_dump/pg_dump.c	Sun Dec  1 03:24:48 2002
***************
*** 4918,4924 ****
  	 * wire-in knowledge about the default public privileges for different
  	 * kinds of objects.
  	 */
! 	appendPQExpBuffer(sql, "REVOKE ALL ON %s %s FROM PUBLIC;\n",
  					  type, name);
  
  	/* Make a working copy of acls so we can use strtok */
--- 4918,4924 ----
  	 * wire-in knowledge about the default public privileges for different
  	 * kinds of objects.
  	 */
! 	appendPQExpBuffer(sql, "REVOKE ALL ON %s %s FROM public;\n",
  					  type, name);
  
  	/* Make a working copy of acls so we can use strtok */
***************
*** 4980,4986 ****
  				if (eqpos == tok)
  				{
  					/* Empty left-hand side means "PUBLIC" */
! 					appendPQExpBuffer(sql, "PUBLIC;\n");
  				}
  				else if (strncmp(tok, "group ", strlen("group ")) == 0)
  					appendPQExpBuffer(sql, "GROUP %s;\n",
--- 4980,4986 ----
  				if (eqpos == tok)
  				{
  					/* Empty left-hand side means "PUBLIC" */
! 					appendPQExpBuffer(sql, "public;\n");
  				}
  				else if (strncmp(tok, "group ", strlen("group ")) == 0)
  					appendPQExpBuffer(sql, "GROUP %s;\n",



In response to

Responses

pgsql-hackers by date

Next:From: Christopher Kings-LynneDate: 2002-12-01 02:05:29
Subject: Re: Hard-coded PUBLIC in pg_dump
Previous:From: Christopher Kings-LynneDate: 2002-12-01 00:27:50
Subject: Re: 7.4 Wishlist

pgsql-advocacy by date

Next:From: Christopher Kings-LynneDate: 2002-12-01 02:05:29
Subject: Re: Hard-coded PUBLIC in pg_dump
Previous:From: Christopher Kings-LynneDate: 2002-12-01 00:27:50
Subject: Re: 7.4 Wishlist

pgsql-general by date

Next:From: Christopher Kings-LynneDate: 2002-12-01 02:05:29
Subject: Re: Hard-coded PUBLIC in pg_dump
Previous:From: eleinDate: 2002-12-01 00:32:11
Subject: Re: returning CHAR from C function

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