0

I have this database table in postgres:

CREATE TABLE dummytable (
     id bigint NOT NULL,
     fieldvalue character varying(255)
)

How can i changed the datatype of the field "fieldvalue" to an endless character datatype? Is that possible?

2 Answers 2

1

Use the text data type

CREATE TABLE dummytable (
     id bigint NOT NULL,
     fieldvalue text
)

To alter an existent table

alter table dummytable
alter column fieldvalue
set data type text;
Sign up to request clarification or add additional context in comments.

2 Comments

Or varchar without a length.
ok thanks, how can i set this field datatype with an sql update statements?
0
ALTER TABLE dummytable ALTER COLUMN fieldvalue TYPE TEXT;

For more ALTER TABLE option see this link: PostgreSQL - Alter Table

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.