Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4b130b2

Browse files
committed
Fix for Alter TABLE add column varchar(). Was causing zero length.
1 parent620f014 commit4b130b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/commands/command.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.5 1996/11/06 08:21:30 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.6 1996/11/17 04:23:10 momjian Exp $
1111
*
1212
* NOTES
1313
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -444,7 +444,10 @@ PerformAddAttribute(char *relationName,
444444
}
445445
namestrcpy(&(attribute->attname), (char*)key[1].sk_argument);
446446
attribute->atttypid=typeTuple->t_oid;
447-
attribute->attlen=form->typlen;
447+
if (form->typlen>0)
448+
attribute->attlen=form->typlen;
449+
else/* bpchar and varchar */
450+
attribute->attlen=colDef->typename->typlen;
448451
attribute->attnum=i;
449452
attribute->attbyval=form->typbyval;
450453
attribute->attnelems=attnelems;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp