Re: how to modify a field - Mailing list pgsql-novice

From Jason Earl
Subject Re: how to modify a field
Date
Msg-id 87y9ja81jf.fsf@npa01zz001.simplot.com
Whole thread Raw
In response to how to modify a field  ("Terry BD7NQ" <bd7nq@hellocq.net>)
List pgsql-novice
Unfortunately there isn't really a good way to do this in PostgreSQL.
What you are probably going to end up doing is creating a temporary
table with the new schema that you want, copying that data to this new
table with an 'insert into' query, delete the old table, and rename
the new table.

You will probably also want to get rid of the sequence object that
your serial type created, and heaven help you if you had a pile of
triggers set for this table.

Good Luck,
Jason

"Terry BD7NQ" <bd7nq@hellocq.net> writes:

> Hi Gentleman,
>
> 1. How to modify a field in the table structure, such I have a filed name
> 'userid', its type is serial, now I want to change ti to varchar?
> 2. How to delete a field in the table structure?
>
> Terry
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

pgsql-novice by date:

Previous
From: "Terry BD7NQ"
Date:
Subject: how to modify a field
Next
From: David Link
Date:
Subject: Postgres and XML