Re: Populate unique column with default value

From: Rodrigo De Le� <rdeleonp(at)gmail(dot)com>
To: "Jon Horsman" <horshaq(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:39:55
Message-ID: a55915760710010839u5e11e850sa0850564f73eaf4f@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;

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jon Horsman 2007-10-01 15:51:10 Re: Populate unique column with default value
Previous Message Jon Horsman 2007-10-01 15:33:00 Re: Populate unique column with default value