pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Don't understand creation statement's answer
3+ messages / 3 participants
[nested] [flat]

* Don't understand creation statement's answer
@ 2000-12-17 23:32 Thomas SMETS <tsmets@altern.org>
  2000-12-18 00:08 ` Re: Don't understand creation statement's answer Mathijs Brands <mathijs@ilse.nl>
  2000-12-21 05:59 ` Re: Don't understand creation statement's answer Christopher Sawtell <csawtell@xtra.co.nz>
  0 siblings, 2 replies; 3+ messages in thread

From: Thomas SMETS @ 2000-12-17 23:32 UTC (permalink / raw)
  To: pgsql-sql


Hi,

In the long term I'm willing to construct a Little Java application that
runs a library. I was looking to create a few table & connect them
according to a non existing model . To create the Author table here's
what I thought doing for a table that should only contain The Name & the
Surname of the Author (once per Author).


<snip>
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'
CREATE
tsmets=> \d author
                              Table "author"
 Attribute |     Type      |                   Modifier
-----------+---------------+----------------------------------------------
 author_id | numeric(30,6) | not null default
nextval('author_seq'::text)
 name      | char(25)      | not null
 surname   | char(25)      | not null
Index: author_pkey
 
tsmets=>                       
</snip>

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 ?

That for highlighting the meaning of this ?

Thomas,



-- 
Sun Dec 17 19:42:31 CET 2000

Thomas SMETS                        e-mail : tsmets@altern.org
Av. de la Brabançonne 133 / 3       Tel. : +32 (0)2 742. 05. 94.
1030 Bruxelles
======= Quote of the Day =========
If at first you don't succeed, you must be a programmer.
========= End of Quote ===========



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Don't understand creation statement's answer
  2000-12-17 23:32 Don't understand creation statement's answer Thomas SMETS <tsmets@altern.org>
@ 2000-12-18 00:08 ` Mathijs Brands <mathijs@ilse.nl>
  1 sibling, 0 replies; 3+ messages in thread

From: Mathijs Brands @ 2000-12-18 00:08 UTC (permalink / raw)
  To: Thomas SMETS <tsmets@altern.org>; +Cc: 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 



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Don't understand creation statement's answer
  2000-12-17 23:32 Don't understand creation statement's answer Thomas SMETS <tsmets@altern.org>
@ 2000-12-21 05:59 ` Christopher Sawtell <csawtell@xtra.co.nz>
  1 sibling, 0 replies; 3+ messages in thread

From: Christopher Sawtell @ 2000-12-21 05:59 UTC (permalink / raw)
  To: Thomas SMETS <tsmets@altern.org>; pgsql-sql

On Mon, 18 Dec 2000 12:32, Thomas SMETS wrote:
> Hi,
>
> In the long term I'm willing to construct a Little Java application that
> runs a library.

you might find http://www.koha.org interesting

Library management on all free software.

-- 
Sincerely etc.,

 NAME       Christopher Sawtell
 CELL PHONE 021 257 4451
 ICQ UIN    45863470
 EMAIL      csawtell @ xtra . co . nz
 CNOTES     ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz

 -->> Please refrain from using HTML or WORD attachments in e-mails to me <<--




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2000-12-21 05:59 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-17 23:32 Don't understand creation statement's answer Thomas SMETS <tsmets@altern.org>
2000-12-18 00:08 ` Mathijs Brands <mathijs@ilse.nl>
2000-12-21 05:59 ` Christopher Sawtell <csawtell@xtra.co.nz>

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