Re: Don't understand creation statement's answer

Поиск
Список
Период
Сортировка
От Mathijs Brands
Тема Re: Don't understand creation statement's answer
Дата
Msg-id 20001218010855.B2054@ilse.nl
обсуждение исходный текст
Ответ на Don't understand creation statement's answer  (Thomas SMETS <tsmets@altern.org>)
Список 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 


В списке pgsql-sql по дате отправления:

Предыдущее
От: Thomas SMETS
Дата:
Сообщение: Don't understand creation statement's answer
Следующее
От: Dan Vanags
Дата:
Сообщение: sql/database admin courses