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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general 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 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

Browse pgsql-advocacy by date

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

Browse pgsql-general by date

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

Browse pgsql-hackers by date

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