diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 7381fd77b93..58e79da87b9 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Yann Droneaud * Copyright (C) 2012 Florian Henry + * Copyright (C) 2015 Marcos GarcĂ­a * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -255,7 +256,7 @@ class DoliDBPgsql extends DoliDB $newreg3=preg_replace('/ NOT NULL/i','',$newreg3); $newreg3=preg_replace('/ NULL/i','',$newreg3); $newreg3=preg_replace('/ DEFAULT 0/i','',$newreg3); - $newreg3=preg_replace('/ DEFAULT \'[0-9a-zA-Z_@]*\'/i','',$newreg3); + $newreg3=preg_replace('/ DEFAULT \'?[0-9a-zA-Z_@]*\'?/i','',$newreg3); $line.= "ALTER TABLE ".$reg[1]." ALTER COLUMN ".$reg[2]." TYPE ".$newreg3; // TODO Add alter to set default value or null/not null if there is this in $reg[3] }