Re: Modifying column size

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Susan Lane <suel(at)dpn(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Modifying column size
Date: 2002-07-19 22:12:38
Message-ID: 20020719150925.D85491-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
:) )

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-19 22:33:15 Re: brk() function and performance
Previous Message Susan Lane 2002-07-19 22:12:01 Re: COMMIT in PostgreSQL