Thread: First decent PostgreSQL CBT now on techdocs.postgresql.org

First decent PostgreSQL CBT now on techdocs.postgresql.org

From
Justin Clift
Date:
Hi everyone,

For the last month and a half or so I've pretty much devoted all my
spare time to creating the first of a series of Macromedia Flash Player
based tutorials on aspects of PostgreSQL.  I'm working to get a decent
Computer Based Training (CBT) implementation going, and I'm fairly proud
of how this first effort has turned out.

The subject of this first PostgreSQL CBT is "Sequences", as a lot of new
users don't seem to understand what they are or how they're used.

This CBT (247k in size) has been created using a program called SWiSH
(which I'm never going to use for a project this big again), and is on
the techdocs.postgresql.org website at :

http://techdocs.postgresql.org/college/001_sequences/

What I'm hoping to get is constructive feedback, as I've put as much
time, thought, and effort into this first one as I know how to.  I'm
talking HEAPS.  Suggestions of what should be the subject of the next
CBT are also welcome.

Please, even if you're a guru, take a look and tell me what you think.

:-)

Regards and best wishes,

Justin Clift

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi

Re: First decent PostgreSQL CBT now on techdocs.postgresql.org

From
"Serguei Mokhov"
Date:
----- Original Message -----
From: Justin Clift <justin@postgresql.org>
Sent: Tuesday, December 25, 2001 4:41 PM

> The subject of this first PostgreSQL CBT is "Sequences", as a lot of new
> users don't seem to understand what they are or how they're used.
>
> This CBT (247k in size) has been created using a program called SWiSH
> (which I'm never going to use for a project this big again), and is on
> the techdocs.postgresql.org website at :
>
> http://techdocs.postgresql.org/college/001_sequences/
>
> What I'm hoping to get is constructive feedback, as I've put as much
> time, thought, and effort into this first one as I know how to.  I'm
> talking HEAPS.  Suggestions of what should be the subject of the next
> CBT are also welcome.

I've found it quite helpful. There were things I wasn't aware of  - shame
on me, thanks to you! :)

I think I've found a bug there:

  o The frame entitled as "The optional keywords", for the MAXVALUE, last
    part of the sentence says "..., and is also the number the sequence will
    wrap around to if _is_called_ is true." I believe, "is_called" should
    be changed to "is_cycled".

  o The same copy-paste bug seems to be for the MINVALUE as well.

As for the user interface, could you make it a bit bigger and bolder
font maybe?

A question for you, Justin: how would it be possible to make a translation
of it to other languages?

Thank you for the good work!

--
Serguei A. Mokhov




Re: First decent PostgreSQL CBT now on techdocs.postgresql.org

From
Joe Conway
Date:
Justin Clift wrote:

> For the last month and a half or so I've pretty much devoted all my
> spare time to creating the first of a series of Macromedia Flash Player
> based tutorials on aspects of PostgreSQL.  I'm working to get a decent
> Computer Based Training (CBT) implementation going, and I'm fairly proud
> of how this first effort has turned out.
>



You should be -- very nice work!


> What I'm hoping to get is constructive feedback, as I've put as much
> time, thought, and effort into this first one as I know how to.  I'm
> talking HEAPS.  Suggestions of what should be the subject of the next
> CBT are also welcome.

Two minor comments:

First, in 7.2+ sequences are based on 8 byte integers on platforms which
support them, so the default maxvalue is 9223372036854775807 instead of
2147483647.

Second, the currval function returns the "value most recently obtained
by nextval for this sequence in the current server process" -- i.e. it
only shows the last value obtained in your own session, and will give an
error if nextval has not already been called within the current session.

If you decide to do a CBT on use of the bytea data type, I'd be happy to
try to help.

Take care (and Happy Holidays!),

-- Joe



Re: First decent PostgreSQL CBT now on techdocs.postgresql.org

From
Bruce Momjian
Date:
> > What I'm hoping to get is constructive feedback, as I've put as much
> > time, thought, and effort into this first one as I know how to.  I'm
> > talking HEAPS.  Suggestions of what should be the subject of the next
> > CBT are also welcome.
>
> Two minor comments:
>
> First, in 7.2+ sequences are based on 8 byte integers on platforms which
> support them, so the default maxvalue is 9223372036854775807 instead of
> 2147483647.

I do have a question about that.  If I do this:

    test=> create table test (x serial);
    NOTICE:  CREATE TABLE will create implicit sequence 'test_x_seq' for SERIAL column 'test.x'
    NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'test_x_key' for table 'test'
    CREATE
    test=> \d test
                               Table "test"
     Column |  Type   |                   Modifiers
    --------+---------+------------------------------------------------
     x      | integer | not null default nextval('"test_x_seq"'::text)
    Unique keys: test_x_key

    test=>

My column is an integer.  I assume that is 4 bytes on all platforms.  If
it isn't, how does it know if the receiving end supports 8 bytes
integers?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: First decent PostgreSQL CBT now on techdocs.postgresql.org

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I do have a question about that.  If I do this:
>     test=> create table test (x serial);
> My column is an integer.

So it is.  When the sequence reaches 2147483648 you'll start getting
ERROR:  int8 conversion to int4 is out of range

            regards, tom lane

Re: First decent PostgreSQL CBT now on techdocs.postgresql.org

From
Bruce Momjian
Date:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I do have a question about that.  If I do this:
> >     test=> create table test (x serial);
> > My column is an integer.
>
> So it is.  When the sequence reaches 2147483648 you'll start getting
> ERROR:  int8 conversion to int4 is out of range

Uh, so what is the advantage of using int8 sequences internally?  Just
the error message?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: First decent PostgreSQL CBT now on techdocs.postgresql.org

From
Bruce Momjian
Date:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Uh, so what is the advantage of using int8 sequences internally?
>
> You can use "serial8", a/k/a "bigserial".

Oh, I see that now in HISTORY.  Thanks.

   New SERIAL8 creates int8 columns with sequences, default still SERIAL4 (Tom)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: First decent PostgreSQL CBT now on techdocs.postgresql.org

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Uh, so what is the advantage of using int8 sequences internally?

You can use "serial8", a/k/a "bigserial".

            regards, tom lane