PostgreSQL's 'text' data type does not support a size modifier. Torque,
however, generates 'text(65535)' or something to that effect.

At first I thought this was something recent, a change between
PostgreSQL 7 and 8, but as far as I can tell this has never been
allowed. So I made some changes in the templates project (it's very nice
that this is a separate project!).

My solution was to copy src/templates/sql/base/mssql/columns.vm into
src/templates/sql/base/postgresql. The diff is attached (I was bold
enough to also change some white space so the resulting schema is a bit
nicer).

Bye,
Hilco
Index: src/templates/sql/base/postgresql/columns.vm
===================================================================
--- src/templates/sql/base/postgresql/columns.vm	(revision 332084)
+++ src/templates/sql/base/postgresql/columns.vm	(working copy)
@@ -12,6 +12,13 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 #foreach ($col in $table.Columns)
-    #set ( $entry = "$col.SqlString," )
+#set ( $type = $col.Domain.SqlType )
+#if ($type == "INT" || $type == "TEXT")
+#set ( $size = "" )
+#else
+#set ( $size = $col.printSize() )
+#end
+#set ( $default = $col.DefaultSetting )
+#set ( $entry = "$col.Name $type$size $default $col.NotNullString $col.AutoIncrementString," )
     $strings.sub($strings.collapseSpaces($entry)," ,",",")
 #end

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to