Fix problem with doing 7.0.X dumps on character varying[] fields.
Christopher Kings-Lynne
This commit is contained in:
parent
4807619251
commit
0d5364fd98
@ -12,7 +12,7 @@
|
|||||||
* by PostgreSQL
|
* by PostgreSQL
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.371 2004/05/25 01:00:24 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.372 2004/05/26 18:24:22 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -7722,8 +7722,16 @@ static char *
|
|||||||
myFormatType(const char *typname, int32 typmod)
|
myFormatType(const char *typname, int32 typmod)
|
||||||
{
|
{
|
||||||
char *result;
|
char *result;
|
||||||
|
bool isarray = false;
|
||||||
PQExpBuffer buf = createPQExpBuffer();
|
PQExpBuffer buf = createPQExpBuffer();
|
||||||
|
|
||||||
|
/* Handle array types */
|
||||||
|
if (typname[0] == '_')
|
||||||
|
{
|
||||||
|
isarray = true;
|
||||||
|
typname++;
|
||||||
|
}
|
||||||
|
|
||||||
/* Show lengths on bpchar and varchar */
|
/* Show lengths on bpchar and varchar */
|
||||||
if (!strcmp(typname, "bpchar"))
|
if (!strcmp(typname, "bpchar"))
|
||||||
{
|
{
|
||||||
@ -7767,6 +7775,10 @@ myFormatType(const char *typname, int32 typmod)
|
|||||||
else
|
else
|
||||||
appendPQExpBuffer(buf, "%s", fmtId(typname));
|
appendPQExpBuffer(buf, "%s", fmtId(typname));
|
||||||
|
|
||||||
|
/* Append array qualifier for array types */
|
||||||
|
if (isarray)
|
||||||
|
appendPQExpBuffer(buf, "[]");
|
||||||
|
|
||||||
result = strdup(buf->data);
|
result = strdup(buf->data);
|
||||||
destroyPQExpBuffer(buf);
|
destroyPQExpBuffer(buf);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user