Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0d5364f

Browse files
committed
Fix problem with doing 7.0.X dumps on character varying[] fields.
Christopher Kings-Lynne
1 parent 4807619 commit 0d5364f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.371 2004/05/25 01:00:24 momjian Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.372 2004/05/26 18:24:22 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -7722,8 +7722,16 @@ static char *
77227722
myFormatType(const char *typname, int32 typmod)
77237723
{
77247724
char *result;
7725+
bool isarray = false;
77257726
PQExpBuffer buf = createPQExpBuffer();
77267727

7728+
/* Handle array types */
7729+
if (typname[0] == '_')
7730+
{
7731+
isarray = true;
7732+
typname++;
7733+
}
7734+
77277735
/* Show lengths on bpchar and varchar */
77287736
if (!strcmp(typname, "bpchar"))
77297737
{
@@ -7767,6 +7775,10 @@ myFormatType(const char *typname, int32 typmod)
77677775
else
77687776
appendPQExpBuffer(buf, "%s", fmtId(typname));
77697777

7778+
/* Append array qualifier for array types */
7779+
if (isarray)
7780+
appendPQExpBuffer(buf, "[]");
7781+
77707782
result = strdup(buf->data);
77717783
destroyPQExpBuffer(buf);
77727784

0 commit comments

Comments
 (0)