D
D
Dmitry Nikitin2015-03-26 11:34:54
PostgreSQL
Dmitry Nikitin, 2015-03-26 11:34:54

Changing data type from numeric to integer?

How can PostgreSQL cast data types from a single data type, such as numeric to integer?
Those. there are tables and with one sql query we write a command to transfer the data type of two fields from one to another.
So how to execute dynamic ddl in anonymous block using pgAdmin?
8d7cdc7c9ff14d6981f7095449108bd0.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
whats, 2015-03-26
@whats

Do you understand the question? Anonymous block? What it is ?
Change the type of an existing column

ALTER TABLE articles
    ALTER COLUMN manufacturer TYPE integer -> На какой тип меняем
    USING manufacturer::integer; -> Преобразовываем значения

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question