Re: Finding Max Value in a Row

From: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
To: "PostgreSQL (SQL)" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Finding Max Value in a Row
Date: 2012-05-11 19:50:15
Message-ID: CAAQLLO5x8_kxpM8epdqjh7UPG7tTX8i0w04fODZd1F+8bKdr0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, May 11, 2012 at 3:44 PM, Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:
> Use this:
>
> alter table users
>    alter column users_id type integer using to_number(users_id, '99999');
>
> (Adjust the '99999' to the length of the char column)

When you wrote "Adjust the '99999' to the length of the char column,
do you mean change '99999' to '312' if my last used maximum value was
312? So the next sequence primary key value would be '313', right?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Carlos Mennens 2012-05-11 19:53:59 Re: Finding Max Value in a Row
Previous Message Thomas Kellerer 2012-05-11 19:44:03 Re: Finding Max Value in a Row