Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 85A759F9255 for ; Tue, 6 Nov 2007 17:59:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 11020-05 for ; Tue, 6 Nov 2007 17:59:17 -0400 (AST) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.190]) by postgresql.org (Postfix) with ESMTP id 79AE59F926C for ; Tue, 6 Nov 2007 17:59:47 -0400 (AST) Received: by mu-out-0910.google.com with SMTP id i10so2375209mue for ; Tue, 06 Nov 2007 13:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; bh=gSw+EeFcFqLyqBaO67C5pMk98ypaScWMoQnFQNGPy+0=; b=se+U962eqBKJJPfvuYYY0OQQW9mvti7bo07Zd+YNLgoTfLXNrex3tnofAiVXRsr6VvlTZ9MgRQV07sgOGmkFzMa6Y3b+fUHmfUD2VWIJ3770spBgr67b9j1i/mNqf5z5ih6vQBbhA6fdVxaZH9VXDjL+nFOeErQfppYn4ynJwVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=pKnuBOgjxHXga3g4GzqigWpK5vQVTKxmeflhyJzEaH75qDEv9/1KfRk8ap0b2hw3qCvmvpcBv2O1SJaQ2Nlcn3tTsRxqql+mYsmtSr6iXp3sGkVPPLNwfNMaA6M/8kyOmKYLIvZpgHoHF811N2q7fBcEJh5QcsjHIJaDowZnMQg= Received: by 10.64.3.9 with SMTP id 9mr2688151qbc.1194386384511; Tue, 06 Nov 2007 13:59:44 -0800 (PST) Received: by 10.64.233.15 with HTTP; Tue, 6 Nov 2007 13:59:44 -0800 (PST) Message-ID: Date: Tue, 6 Nov 2007 16:59:44 -0500 From: "Erik Aronesty" To: pgsql-admin@postgresql.org Subject: alter table serial->int MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 895923f4b882584b X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/59 X-Sequence-Number: 27302 for some odd reason when i try to change a table fromserial to just plain "int with a default" postgres seems to ignore me. when i dump the schema i get ... CREATE TABLE custom ( id serial NOT NULL, name text, email text, ); then i run... alter table custom alter id type int; alter table custom alter id set default ((nextval('custom_seq'::regclass) * 100) + ((random() * (100)::double precision))::integer); after running these 2 alter table commands... i dump the schema ... and voila... nothing happened.... CREATE TABLE custom ( id serial NOT NULL, name text, email text, ); or did it? the change actually works... i see the new slightly randomized ids going in nicely my only problem is that backups aren't going to restore correctly since the schema dumps wrong