pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: operationsengineer1@yahoo.com
To: Penchalaiah P. <penchalaiahp@infics.com>
To: pgsql-sql@postgresql.org
Subject: Re: i have  table
Date: Wed, 4 Oct 2006 18:23:35 -0700 (PDT)
Message-ID: <20061005012335.14210.qmail@web33305.mail.mud.yahoo.com> (raw)
In-Reply-To: <A70AE049E81A6A40879D5DC0AC8C38C9073DCD8F@venus.infics.com>

--- "Penchalaiah P." <penchalaiahp@infics.com> wrote:

> 
> Hi ...
> 
> I have one table with 12 fields..
> 
> 
> 
> CREATE TABLE addition_alteration_memo
> 
> (
> 
>   addition_alteration_memo int8 NOT NULL DEFAULT
>
nextval('addition_alteration_memo_addition_alteration_memo_seq'::regclas
> s),
> 
>   cda_no varchar(7) NOT NULL,
> 
>   week numeric,
> 
>   sheet_no numeric,
> 
>   serial_no numeric,
> 
>   date date,
> 
>   dr_no varchar,
> 
>   amount numeric,
> 
>   memo_no varchar,
> 
>   memo_date date,
> 
>   no_instalments numeric,
> 
>   instalment_rate numeric)
> 
> 
> 
> now I want to add one more field in this table.. but
> that field has to
> come next to cda_no.. I mean as a 3rd field.. If I
> am adding that field
> it is coming last field ...
> 
> may I know how it is possible to that table...
> 
> 
> 
> Thanks  &  Regards
> 
> Penchal reddy | Software Engineer          

Penchal,

yes, you can do this, but it isn't necessary beyond
making you feel more comfortable when you look at your
column names in something like pgadmin3.

i don't have my code in front of me, but what you do
is export your table definitions into sql text.  there
is a statement you can put at the beginning of the
table that deletes it if it already exists.  

update the text file with the columns in order and
then import the sql table definitions.

your original table is deleted (if it exists) and the
new table is generated in the order you want it.

when i get some time on the computer where i've done
this, i will post an example.

oe1

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



view thread (19+ messages)  latest in thread

Message-ID: <20061005012335.14210.qmail@web33305.mail.mud.yahoo.com>
Permalink:  ../20061005012335.14210.qmail@web33305.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20061005012335.14210.qmail@web33305.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: operationsengineer1@yahoo.com, penchalaiahp@infics.com
  Subject: Re: i have  table
  In-Reply-To: <20061005012335.14210.qmail@web33305.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox