Re: Don't understand creation statement's answer

From: Mathijs Brands <mathijs(at)ilse(dot)nl>
To: Thomas SMETS <tsmets(at)altern(dot)org>
Cc: psql sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Don't understand creation statement's answer
Date: 2000-12-18 00:08:55
Message-ID: 20001218010855.B2054@ilse.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-12-18 03:47:55 Re: [SQL] PostgreSQL crashes on me :(
Previous Message Thomas SMETS 2000-12-17 23:32:54 Don't understand creation statement's answer