473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ALTER Table

Hi,
is it possible to add a column to a table at a specific place ? Reading
the man pages i could not figure that out.

Thanks.
Alex

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
4 2455
Alex wrote:
is it possible to add a column to a table at a specific place ? Reading
the man pages i could not figure that out.


Why do you want to add it at specific location? What does it achieve?

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #2
Shridhar Daithankar wrote:
Alex wrote:
is it possible to add a column to a table at a specific place ?
Reading the man pages i could not figure that out.

Why do you want to add it at specific location? What does it achieve?


I miss the same feature too, this is my reason:
is just to keep clean your schema, I have in my revision control system
all tables with fields grouped for tipology:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

when I add let me say Gn+1 in my RCS I have:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
Gn+1 as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

and will be nice to have in my fourther dumps
the same structure, just to do a DIFF betwen two schemas
without become crazy!
I hope I was clear enough.
Regards
Gaetano Mendola





---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #3
Gaetano Mendola wrote:
Shridhar Daithankar wrote:
Alex wrote:
is it possible to add a column to a table at a specific place ?
Reading the man pages i could not figure that out.


Why do you want to add it at specific location? What does it achieve?

I miss the same feature too, this is my reason:
is just to keep clean your schema, I have in my revision control system
all tables with fields grouped for tipology:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

when I add let me say Gn+1 in my RCS I have:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
Gn+1 as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

and will be nice to have in my fourther dumps
the same structure, just to do a DIFF betwen two schemas
without become crazy!


Well, if you diff two schema dumps, you will find one line added to correct
scope i.e. {} block because it belongs to same table. And anyway there is big
difference between schema diffs and database diffs. Sure you can not produce an
SQL script which would bring two databases to same state.

Only thing that can be done is to manually reordering the schema since it gives
you pretty localised view of changes due to repository.

Also check http://www.varlena.com/varlena/GeneralBits/30.html. The last bit
summerises another discussion on this.

HTH

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #4
Shridhar Daithankar wrote:
Gaetano Mendola wrote:
Shridhar Daithankar wrote:
Alex wrote:

is it possible to add a column to a table at a specific place ?
Reading the man pages i could not figure that out.


Why do you want to add it at specific location? What does it achieve?


I miss the same feature too, this is my reason:
is just to keep clean your schema, I have in my revision control system
all tables with fields grouped for tipology:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

when I add let me say Gn+1 in my RCS I have:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
Gn+1 as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

and will be nice to have in my fourther dumps
the same structure, just to do a DIFF betwen two schemas
without become crazy!

Well, if you diff two schema dumps, you will find one line added to
correct scope i.e. {} block because it belongs to same table. And anyway
there is big difference between schema diffs and database diffs. Sure
you can not produce an SQL script which would bring two databases to
same state.

Only thing that can be done is to manually reordering the schema since
it gives you pretty localised view of changes due to repository.

Also check http://www.varlena.com/varlena/GeneralBits/30.html. The last
bit summerises another discussion on this.


Yes but the missing feature is there.
Regards
Gaetano Mendola


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dylan Nicholson | last post by:
Seems that Oracle 9.2 (using MS ODBC driver) requires extra parentheses when adding multiple columns to a table: ALTER TABLE MyTable ADD (MyColumn1 VARCHAR(255), MyColumn2 VARCHAR(255)) vs ...
1
by: Lannsjo | last post by:
I need to change my primary key column type from smallint to int. I have tried: ALTER TABLE livegroup MODIFY id INT UNSIGNED NOT NULL AUTO_INCREMENT; But get an error message certainly since my...
1
by: Stephen Miller | last post by:
Is it possible to ALTER a temporary table in TSQL (SQL2000)? The following TSQL reports a syntax error at the ALTER TABLE line: DECLARE @Test TABLE( NOT NULL , NOT NULL ) ALTER TABLE...
2
by: me | last post by:
I would like to add an Identity to an existing column in a table using a stored procedure then add records to the table and then remove the identity after the records have been added or something...
4
by: maricel | last post by:
Could someone confirm which tablespace is being used when running ALTER & CREATE INDEX. Is it the tempspace or the tablespace where the table resides? Many thanks, maricel
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
2
by: RamaKrishna Narla | last post by:
In MS SQL Server, I have the following tables with some data in it. create table table1 ( column1 varchar(32), column2 int not null, column10 varchar(255), ..... primary key (column1,...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
1
by: vasilip | last post by:
I'm testing out db2 for a project I'm starting that requires proper xml support and I can't seem to get both xml and spatial data to work well in the same table. Once having created a table...
11
by: raylopez99 | last post by:
Keep in mind this is my first compiled SQL program Stored Procedure (SP), copied from a book by Frasier Visual C++.NET in Visual Studio 2005 (Chap12). So far, so theory, except for one bug...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.