Re: Modifying column size - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Modifying column size
Date
Msg-id 20020719150925.D85491-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Modifying column size  ("Susan Lane" <suel@dpn.com>)
List pgsql-general
On Fri, 19 Jul 2002, Susan Lane wrote:

> I was wondering if anyone here knew of a way to modify the size of a column
> in Postgres.  In Oracle, you can use the following syntax:
>
>     alter table usrs modify passwd varchar2(32);    (For Postgres, I changed
> the datatype to varchar)
>
> But, when I try this in psql, it doesn't like the modify keyword.  I looked
> in the documentation, and I found a doc note that someone else had tried
> this as well to no avail.  Anybody know what is the correct syntax or if
> this can even be done in Postgres?

In general, not really (as per other answers).

For the specific cases of varchar of one size to varchar of a larger size,
you can do so with some system table hacking.  In general, unless you've
got constraints/views/etc to prevent you from making a new table, copying
the data and renaming, I'd suggest against it.  (If you really want to
know, you can ask about it specifically or better yet, check the archives
:) )




pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: brk() function and performance
Next
From: "Susan Lane"
Date:
Subject: Re: Modifying column size