Re: Finding Max Value in a Row

Поиск
Список
Период
Сортировка
От Carlos Mennens
Тема Re: Finding Max Value in a Row
Дата
Msg-id CAAQLLO7-O26xpisutPoud__iDaco6WtZCr6CBG5OgiwpgvWd6g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Finding Max Value in a Row  ("David Johnston" <polobo@yahoo.com>)
Ответы Re: Finding Max Value in a Row  (Thomas Kellerer <spam_eater@gmx.net>)
Re: Finding Max Value in a Row  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: Finding Max Value in a Row  (Viktor Bojović <viktor.bojovic@gmail.com>)
Список pgsql-sql
Thanks for all the help thus far everyone! I sadly didn't
create/design the table and would love to create a SEQUENCE on that
particular field but not sure how unless I DROP the table and create
from scratch.

Currently the data TYPE on the primary key field (users_id) is CHAR
and I have no idea why...it should be NUMERIC or SERIAL but it's not
so my question is if I want to ALTER the column and create a sequence,
would I simply do:

ALTER TABLE users
ALTER COLUMN users_id TYPE serial
;

Obviously if any of the data stored in users_id is actual CHAR, I'm
guessing the database would reject that request to change type as the
existing data would match. However the data type is CHAR but the field
values are all numeric from 1000000010 - 1000000301 so I'm hoping that
would work for SERIAL which is just INTEGER, right?


В списке pgsql-sql по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Finding Max Value in a Row
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_dump: aborting because of server version mismatch