pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mathijs Brands <mathijs@ilse.nl>
To: Thomas SMETS <tsmets@altern.org>
Cc: psql sql <pgsql-sql@postgresql.org>
Subject: Re: Don't understand creation statement's answer
Date: Mon, 18 Dec 2000 01:08:55 +0100
Message-ID: <20001218010855.B2054@ilse.nl> (raw)
In-Reply-To: <3A3D4D26.9302EE75@altern.org>
References: <3A3D4D26.9302EE75@altern.org>

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 



view thread (3+ messages)  latest in thread

Message-ID: <20001218010855.B2054@ilse.nl>
Permalink:  ../20001218010855.B2054@ilse.nl/
Also on:    postgresql.org/message-id/20001218010855.B2054@ilse.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: mathijs@ilse.nl, tsmets@altern.org
  Subject: Re: Don't understand creation statement's answer
  In-Reply-To: <20001218010855.B2054@ilse.nl>
  References: <3A3D4D26.9302EE75@altern.org> <20001218010855.B2054@ilse.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox