Received: from gw.spectrumtelecorp.com (216-064-054-021.inaddr.vitts.com [216.64.54.21]) by hub.org (8.10.1/8.10.1) with ESMTP id e5KH05M72937 for ; Tue, 20 Jun 2000 13:00:05 -0400 (EDT) Received: from spec34 (spec34.spectrumtelecorp.com [192.168.1.67]) by gw.spectrumtelecorp.com (8.9.3/8.8.7) with SMTP id NAA22351; Tue, 20 Jun 2000 13:04:46 -0400 Message-Id: <3.0.1.32.20000620130956.00921820@pop.spectrumtelecorp.com> X-Sender: mikeo@pop.spectrumtelecorp.com X-Mailer: Windows Eudora Pro Version 3.0.1 (32) Date: Tue, 20 Jun 2000 13:09:56 -0400 To: "John McKown" , pgsql-sql@postgresql.org From: mikeo Subject: Re: Re: Simple search question In-Reply-To: References: <39457549.CEA07C63@ihug.com.au> <39459935.CCCEFDAA@ihug.com.au> <87hfaxkelm.fsf@ptdixon.globalnet.co.uk> <39487DD3.7F2BBAE1@ihug.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200006/182 do select setval('seqname',#); At 01:17 PM 6/15/00 -0500, John McKown wrote: > >Alex wrote in message <39487DD3.7F2BBAE1@ihug.com.au>... >>Hi, >> >>> I had the same problem but was using Java, not PHP (I guess that >>> whatever I can do in JDBC, you can do in PHP ;-)). >>> >>> SELECT last_value FROM ; >> >>This brings me back to another unanswered question recently posted up, >maybe >>it is impossible... >>I declared a new table with one of the types as serial (which is really >just a >>sort of macro I believe, which automates the creation of a few things for >your >>convenience), which initialises the last_value of the relation (the >sequence >>itself), as 1. Therefore, upon INSERTing my first row, the serial number >began >>at 1, next was 2, then 3, and so forth. >> My question is, is it possible to alter the sequence last_value column, as >>I need the serial number to begin from 1000? >>Thanks, >>Alex >> > >Nope, I tried doing an > >UPDATE name-of-sequence SET last_value=200 > >and I got an error about not being able to update the sequence. However, >always being one to hit a brick until it cracks, I then tried: > >DROP name-of-sequence; >CREATE name-of-sequence START 1000; > >This seemed to work! When I then INSERTed a new tuple, the attribute defined >as SERIAL actually got the value of 1000. Curious, but nice. > >John McKown (note - not! Jack, but John) > >