X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D5A8D9FB2E3 for ; Mon, 10 Jul 2006 20:57:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 17901-02 for ; Mon, 10 Jul 2006 20:57:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id BEE189FB26C for ; Mon, 10 Jul 2006 20:57:39 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k6ANvV3n095730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Jul 2006 17:57:35 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k6ANvVnm002704; Mon, 10 Jul 2006 17:57:31 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k6ANvVWQ002703; Mon, 10 Jul 2006 17:57:31 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 10 Jul 2006 17:57:30 -0600 From: Michael Fuhr To: KyLiE Cc: pgsql-admin@postgresql.org Subject: Re: %Alter Help Message-ID: <20060710235730.GA2627@winnie.fuhr.org> References: <44B2CCDC.9060407@inegi.gob.mx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44B2CCDC.9060407@inegi.gob.mx> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/64 X-Sequence-Number: 22310 On Mon, Jul 10, 2006 at 04:55:40PM -0500, KyLiE wrote: > Hi all, I have a new question, know i'm trying to alter one of my > tables,but the thing is, that I need to change the range of one of my > columns, I've allready try this: > > ALTER TABLE lugar alter column sitio varchar2(500); > > but it gives me a syntax error. and i don't know why. What's the exact error message and what version of PostgreSQL are you running? At least three things could be contributing to the error: 1. The syntax for altering a column's type is ALTER [ COLUMN ] column TYPE type [ USING expression ] The command you showed is missing the word "TYPE". 2. Altering a column's type is supported only in PostgreSQL 8.0 and later; if you're using 7.4 or earlier then you'll need to perform the steps shown in the FAQ: http://www.postgresql.org/docs/faqs.FAQ.html#item4.3 3. PostgreSQL doesn't have a builtin varchar2 type. Unless you've added varchar2 then use varchar instead. Try this: ALTER TABLE lugar ALTER COLUMN sitio TYPE varchar(500); -- Michael Fuhr