Re: Populate unique column with default value

From: "Jon Horsman" <horshaq(at)gmail(dot)com>
To: Rodrigo De Le� <rdeleonp(at)gmail(dot)com>
Cc: "sql pgsql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Populate unique column with default value
Date: 2007-10-01 15:51:10
Message-ID: 4f4c2a010710010851y29d02056u6c3224ff38ec5b0f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> On 10/1/07, Jon Horsman <horshaq(at)gmail(dot)com> wrote:
> > ... Is there an elegant way i can set the username
> > to be the extension of the current row ...
>
> UPDATE usertable
> SET username = extension
> WHERE username IS NULL;

Hmm, that simple eh, don't I feel stupid =)

Thanks a ton for the quick response.

Jon.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Enrico Weigelt 2007-10-02 20:23:14 Finding broken regex'es
Previous Message Rodrigo De Le� 2007-10-01 15:39:55 Re: Populate unique column with default value