X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id AFE629FA293 for ; Thu, 18 May 2006 12:43:24 -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 27183-07 for ; Thu, 18 May 2006 12:43:20 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.205]) by postgresql.org (Postfix) with ESMTP id C83ED9F9C18 for ; Thu, 18 May 2006 12:43:19 -0300 (ADT) Received: by wx-out-0102.google.com with SMTP id h29so115213wxd for ; Thu, 18 May 2006 08:43:19 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=W4Qtdzn3L9en81yABMPLx+jAPwsS17fUCRGKrJAC1ruk8eEJXbzjg/X7xMZZt9OfhG7SnO3j5EEvibtwIZzLSgtxFqk3FdftKRjkclDqbEd2BAPtnvd3dyjnngqJt1bk0D1t4pkFF+px8+aaxGvruc/Y8g5Ockh1VrP9n8wlhwE= Received: by 10.70.76.17 with SMTP id y17mr810104wxa; Thu, 18 May 2006 08:43:19 -0700 (PDT) Received: by 10.70.8.11 with HTTP; Thu, 18 May 2006 08:43:19 -0700 (PDT) Message-ID: Date: Thu, 18 May 2006 17:43:19 +0200 From: "Guillaume Lelarge" To: "Guillaume LELARGE" , emilu@encs.concordia.ca, pgsql-sql@postgresql.org Subject: Re: Add column and specify the column position in a table In-Reply-To: <20060518140014.GA3122@surnet.cl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <446B9418.3080700@encs.concordia.ca> <446C0BC0.7050805@gmail.com> <20060518140014.GA3122@surnet.cl> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/144 X-Sequence-Number: 25175 2006/5/18, Alvaro Herrera : > Guillaume LELARGE wrote: > > Emi Lu a =E9crit : > > > I am trying to insert one column to a specific position in a table. > > > > > > In mysql, I can do: > > > . create table test(id varchar(3), name varchar(12)); > > > . alter table test add column givename varchar(12) after id; > > > > > > > > > I am looking for similar things in postgresql to add a new column to = the > > > correct position in a table. > > > > There's no similar thing in PostgreSQL. You have to duplicate the table > > to do it. > > ... which is the same thing MySQL does, only you must do it explicitely. > Do you mean that, using "alter table test add column" with the "after" option, MySQL creates a new table, populates it with the old table data and finally drops the old table ? I mean, there's the same performance problem with big tables ? --=20 Guillaume.