Received: from serv1.ilse.nl (serv1.ilse.nl [212.189.131.11]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBI08g630389 for ; Sun, 17 Dec 2000 19:08:42 -0500 (EST) (envelope-from mathijs@ilse.nl) Received: from serv0.ilse.nl (serv0.ilse.nl [212.189.131.10]) by serv1.ilse.nl (8.11.0/8.10.2) with ESMTP id eBI08uo67670; Mon, 18 Dec 2000 01:08:56 +0100 (MET) Received: (from mathijs@localhost) by serv0.ilse.nl (8.8.8/8.6.12) id BAA02486; Mon, 18 Dec 2000 01:08:55 +0100 (MET) Date: Mon, 18 Dec 2000 01:08:55 +0100 From: Mathijs Brands To: Thomas SMETS Cc: psql sql Subject: Re: Don't understand creation statement's answer Message-ID: <20001218010855.B2054@ilse.nl> References: <3A3D4D26.9302EE75@altern.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <3A3D4D26.9302EE75@altern.org>; from tsmets@altern.org on Mon, Dec 18, 2000 at 12:32:54AM +0100 X-Unexpected-Header: The Spanish Inquisition X-Archive-Number: 200012/189 X-Sequence-Number: 523 On Mon, Dec 18, 2000 at 12:32:54AM +0100, Thomas SMETS allegedly wrote: > tsmets=> create sequence author_seq; > CREATE > > tsmets=> create table author ( > tsmets=> author_id numeric primary key default > nextval('author_seq'), > tsmets=> name char(25) not null, > tsmets=> surname char(25) not null > tsmets=> ); > NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index > 'author_pkey' for table 'author' > Now the question is : > What is the meaning of the following statement in the table description > ? > > Attribute | Type | Modifier > -----------+---------------+---------------------------------------------- > author_id | numeric(30,6) | not null default > nextval('author_seq'::text) > > Why was my author_id changesdin a "nextval('author_seq'::text)". > There's no text here ? nextval takes one parameter of the type text. It's just an explicit typecast. The output of nextval is a number, as you requested. I hope this helps, Mathijs -- "Books constitute capital." Thomas Jefferson