Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 519919FA16F for ; Mon, 1 Oct 2007 12:51:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 61125-10 for ; Mon, 1 Oct 2007 12:51:11 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182]) by postgresql.org (Postfix) with ESMTP id 192FD9FA169 for ; Mon, 1 Oct 2007 12:51:11 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id u77so7900495pyb for ; Mon, 01 Oct 2007 08:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Jseuac1KtVksJrfmn+jBzei7rKg8inVs6UoKNEx0gtw=; b=EEBsUqNGaO75zuFo2VRTIu3mcL1Nc/cXuJhfxpkXnmqI8xZpGGtNgYNe8BjvtXvXUKaH+2JMi2pwXFWkLJDWBnWHX77XNROy7cilPjzVVORkrwbh0ejiMGz9pD6ZiuKpe41zGIvM2QzDGTw8KPic4wRSz71T/RIubNmgHuhn5B8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rm9V2M56yuz0ts+6gBeXK9y0RILO8ias4BKvk8HrDt3MzMvdyAkTIZmCPB/+BpBISgh6ybhDwJjgoRoOSj7/R9gwZDtugCIW/7QUH4d1ftlm3dUuHhWIcABSScuPyidMA+BtPta+QZiyLrAaLqb6xNIGdvCTTEaWLnvpIOi0y5Q= Received: by 10.35.109.2 with SMTP id l2mr6568004pym.1191253871088; Mon, 01 Oct 2007 08:51:11 -0700 (PDT) Received: by 10.35.52.15 with HTTP; Mon, 1 Oct 2007 08:51:10 -0700 (PDT) Message-ID: <4f4c2a010710010851y29d02056u6c3224ff38ec5b0f@mail.gmail.com> Date: Mon, 1 Oct 2007 11:51:10 -0400 From: "Jon Horsman" To: "=?UTF-8?Q?Rodrigo_De_Le=EF=BF=BD?=" Subject: Re: Populate unique column with default value Cc: "sql pgsql" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4f4c2a010710010824t7a2fbd59kb9102c879b389a5d@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/4 X-Sequence-Number: 29376 > On 10/1/07, Jon Horsman 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.