From torque-dev-return-6074-apmail-db-torque-dev-archive=db.apache.org@db.apache.org Wed Nov 09 21:10:13 2005 Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 10208 invoked from network); 9 Nov 2005 21:10:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Nov 2005 21:10:13 -0000 Received: (qmail 67062 invoked by uid 500); 9 Nov 2005 21:10:12 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 67040 invoked by uid 500); 9 Nov 2005 21:10:10 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 67029 invoked by uid 99); 9 Nov 2005 21:10:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2005 13:10:10 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [65.39.152.239] (HELO white.metrobridge.net) (65.39.152.239) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2005 13:10:03 -0800 Received: from hwijbenga.dev.elasticpath.com (unknown [66.119.182.210]) by white.metrobridge.net (Postfix) with ESMTP id BABA895C149 for ; Wed, 9 Nov 2005 13:09:47 -0800 (PST) Subject: Postgresql - Text Data Type From: Hilco Wijbenga Reply-To: hilco.wijbenga@elasticpath.com To: torque-dev@db.apache.org Content-Type: multipart/mixed; boundary="=-MRynWBoXsepmvjenlkJH" Organization: Elastic Path Software, Inc. Date: Wed, 09 Nov 2005 13:09:47 -0800 Message-Id: <1131570587.6341.13.camel@hwijbenga.dev.elasticpath.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --=-MRynWBoXsepmvjenlkJH Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-MRynWBoXsepmvjenlkJH Content-Disposition: attachment; filename=colums.vm.diff Content-Type: text/x-patch; name=colums.vm.diff; charset=us-ascii Content-Transfer-Encoding: 7bit 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 --=-MRynWBoXsepmvjenlkJH Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org --=-MRynWBoXsepmvjenlkJH--