Hard-coded PUBLIC in pg_dump - Mailing list pgsql-hackers

From Nicolai Tufar
Subject Hard-coded PUBLIC in pg_dump
Date
Msg-id Pine.GSO.4.10.10212010328110.26370-100000@prana
Whole thread Raw
In response to Re: Locale-dependent case conversion in {identifier}  ("Nicolai Tufar" <ntufar@apb.com.tr>)
Responses Re: Hard-coded PUBLIC in pg_dump
List pgsql-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
workingcopy 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
workingcopy 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",
 




pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: 7.4 Wishlist
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Hard-coded PUBLIC in pg_dump