Skip site navigation (1) Skip section navigation (2)

alter table table add column

From: Ronald Rojas <ronald(dot)rojas(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: alter table table add column
Date: 2007-07-31 04:19:47
Message-ID: 1185855587.28634.6.camel@localhost (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-generalpgsql-novicepgsql-sql
Hi,

Anybody knows how to add column with reference to BEFORE or AFTER any
given column? Let say here's my table structure:

  Column  |       Type        | Modifiers 
----------+-------------------+-----------
 surname  | character varying | 
 lastname | character varying | 
 address   | character varying |

And, I want to add the field name age with type integer after lastname
OR before the address field. How to I do that?

I would really appreciate your response.

Thanks in advance.


==================================================================================================
Ronald Rojas
Systems Administrator
Linux Registered  User #427229
==================================================================================================

Arnold's Laws of Documentation:
	(1) If it should exist, it doesn't.
	(2) If it does exist, it's out of date.
	(3) Only documentation for useless programs transcends the
	    first two laws.


Responses

pgsql-novice by date

Next:From: Michael GlaesemannDate: 2007-07-31 04:32:53
Subject: Re: [NOVICE] alter table table add column
Previous:From: Decibel!Date: 2007-07-31 01:39:02
Subject: Re: Some errors in PostgreSQL installestion

pgsql-general by date

Next:From: Michael GlaesemannDate: 2007-07-31 04:32:53
Subject: Re: [NOVICE] alter table table add column
Previous:From: Tom LaneDate: 2007-07-31 04:09:20
Subject: Re: Stored Proc Problem

pgsql-admin by date

Next:From: Michael GlaesemannDate: 2007-07-31 04:32:53
Subject: Re: [NOVICE] alter table table add column
Previous:From: adeyDate: 2007-07-31 03:13:14
Subject: Re: Lock Statistics

pgsql-sql by date

Next:From: Michael GlaesemannDate: 2007-07-31 04:32:53
Subject: Re: [NOVICE] alter table table add column
Previous:From: Milen A. RadevDate: 2007-07-31 00:34:59
Subject: Re: Table-name as parameter to plpgsql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group