Re: blatantly a bug in the documentation

Lists: pgsql-hackers
From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: blatantly a bug in the documentation
Date: 2008-11-24 11:02:08
Message-ID: 20081124110208.GD23801@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I hope this is the right place to report a bug/issue in the official
documentation...

In
http://www.postgresql.org/docs/current/interactive/plpgsql-control-structures.html
there is an example for a function, cs_refresh_mviews(), chapter 38.6.4.
Within this function there are a "PERFORM cs_log('Refreshing
materialized views...');", but such a function cs_log() are not in the
core distibution.

I think, this is a problem for users which read the doc and try to
reproduce the example or write own code based on the example.

Regards, and many thanks for PostgreSQL to the developer, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net


From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 12:24:47
Message-ID: b42b73150811240424s52e5fcefu6f4b0e095163fa77@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 24, 2008 at 6:02 AM, A. Kretschmer
<andreas(dot)kretschmer(at)schollglas(dot)com> wrote:
> I hope this is the right place to report a bug/issue in the official
> documentation...
>
> In
> http://www.postgresql.org/docs/current/interactive/plpgsql-control-structures.html
> there is an example for a function, cs_refresh_mviews(), chapter 38.6.4.
> Within this function there are a "PERFORM cs_log('Refreshing
> materialized views...');", but such a function cs_log() are not in the
> core distibution.

The example in the docs is pseudo-code. None of the tables referenced
exist either...the purpose of the example was to demonstrate the
syntax of for loops.

merlin


From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 13:22:30
Message-ID: 20081124132230.GG23801@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

am Mon, dem 24.11.2008, um 7:24:47 -0500 mailte Merlin Moncure folgendes:
> On Mon, Nov 24, 2008 at 6:02 AM, A. Kretschmer
> <andreas(dot)kretschmer(at)schollglas(dot)com> wrote:
> > I hope this is the right place to report a bug/issue in the official
> > documentation...
> >
> > In
> > http://www.postgresql.org/docs/current/interactive/plpgsql-control-structures.html
> > there is an example for a function, cs_refresh_mviews(), chapter 38.6.4.
> > Within this function there are a "PERFORM cs_log('Refreshing
> > materialized views...');", but such a function cs_log() are not in the
> > core distibution.
>
> The example in the docs is pseudo-code. None of the tables referenced
> exist either...the purpose of the example was to demonstrate the
> syntax of for loops.

Okay, it is an argument. On the other side, it was a question today in
the irc-channel (#postgresql) today, someone asked, why his funktion
don't work. I think, such examples should not contain such code. It is
not apparent that this function are not available.

Again, thx to all people behind PostgreSQL, it is a great thing and it
has a really informatively documentation. My post was only a hint to
make it better.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 13:38:18
Message-ID: 20081124133817.GC3861@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

A. Kretschmer wrote:

> Okay, it is an argument. On the other side, it was a question today in
> the irc-channel (#postgresql) today, someone asked, why his funktion
> don't work. I think, such examples should not contain such code. It is
> not apparent that this function are not available.

Perhaps the whole chapter could be improved if all the examples referred
to a set of tables and functions previously defined in the introduction
of the chapter. It would be good if the user could cut'n paste the code
and try it out directly, instead of having to reverse engineer the
tables/columns used for each example (and they're quite inconsistent).
Also, some examples give the complete code including CREATE FUNCTION and
others don't.

Feel like submitting a patch?

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 13:47:54
Message-ID: 937d27e10811240547n5c557900wb38b50d2c866bb2c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 24, 2008 at 1:38 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
> A. Kretschmer wrote:
>
>> Okay, it is an argument. On the other side, it was a question today in
>> the irc-channel (#postgresql) today, someone asked, why his funktion
>> don't work. I think, such examples should not contain such code. It is
>> not apparent that this function are not available.
>
> Perhaps the whole chapter could be improved if all the examples referred
> to a set of tables and functions previously defined in the introduction
> of the chapter. It would be good if the user could cut'n paste the code
> and try it out directly, instead of having to reverse engineer the
> tables/columns used for each example (and they're quite inconsistent).
> Also, some examples give the complete code including CREATE FUNCTION and
> others don't.

It might also be useful to create such a database at initdb time so
newbies have something interesting to look at right away.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 13:53:00
Message-ID: 492AB1BC.4070705@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
> On Mon, Nov 24, 2008 at 1:38 PM, Alvaro Herrera
> <alvherre(at)commandprompt(dot)com> wrote:
>
>> A. Kretschmer wrote:
>>
>>
>>> Okay, it is an argument. On the other side, it was a question today in
>>> the irc-channel (#postgresql) today, someone asked, why his funktion
>>> don't work. I think, such examples should not contain such code. It is
>>> not apparent that this function are not available.
>>>
>> Perhaps the whole chapter could be improved if all the examples referred
>> to a set of tables and functions previously defined in the introduction
>> of the chapter. It would be good if the user could cut'n paste the code
>> and try it out directly, instead of having to reverse engineer the
>> tables/columns used for each example (and they're quite inconsistent).
>> Also, some examples give the complete code including CREATE FUNCTION and
>> others don't.
>>
>
> It might also be useful to create such a database at initdb time so
> newbies have something interesting to look at right away.
>

No, there is no need to clutter every installation in the world with
such a database. You could make it an addon module, or a pgfoundry project.

cheers

andrew


From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 13:53:07
Message-ID: 20081124135307.GH23801@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

am Mon, dem 24.11.2008, um 13:47:54 +0000 mailte Dave Page folgendes:
> On Mon, Nov 24, 2008 at 1:38 PM, Alvaro Herrera
> <alvherre(at)commandprompt(dot)com> wrote:
> > A. Kretschmer wrote:
> >
> >> Okay, it is an argument. On the other side, it was a question today in
> >> the irc-channel (#postgresql) today, someone asked, why his funktion
> >> don't work. I think, such examples should not contain such code. It is
> >> not apparent that this function are not available.
> >
> > Perhaps the whole chapter could be improved if all the examples referred
> > to a set of tables and functions previously defined in the introduction
> > of the chapter. It would be good if the user could cut'n paste the code
> > and try it out directly, instead of having to reverse engineer the
> > tables/columns used for each example (and they're quite inconsistent).
> > Also, some examples give the complete code including CREATE FUNCTION and
> > others don't.
>
> It might also be useful to create such a database at initdb time so
> newbies have something interesting to look at right away.

Nice idea.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net


From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 13:56:59
Message-ID: 937d27e10811240556g606805d6l8d2b721b9049f83e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 24, 2008 at 1:53 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
>> It might also be useful to create such a database at initdb time so
>> newbies have something interesting to look at right away.
>>
>
> No, there is no need to clutter every installation in the world with such a
> database. You could make it an addon module, or a pgfoundry project.
>

That would defeat the point. Not that I have any great feelings either
way, but fwiw, Microsoft and Oracle both create a sample database
iirc.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:01:49
Message-ID: 492AB3CD.90306@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
> On Mon, Nov 24, 2008 at 1:53 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>> It might also be useful to create such a database at initdb time so
>>> newbies have something interesting to look at right away.
>>>
>> No, there is no need to clutter every installation in the world with such a
>> database. You could make it an addon module, or a pgfoundry project.
>>
>
> That would defeat the point. Not that I have any great feelings either
> way, but fwiw, Microsoft and Oracle both create a sample database
> iirc.

Last I checked, MS did it optionally only, no?

//Magnus


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:02:37
Message-ID: 17649.1227535357@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Dave Page wrote:
>> It might also be useful to create such a database at initdb time so
>> newbies have something interesting to look at right away.

> No, there is no need to clutter every installation in the world with
> such a database. You could make it an addon module, or a pgfoundry project.

The whole thing strikes me as extreme overkill, not to mention a
misunderstanding of what an example is supposed to be for. If we're
going to insist that every example in the docs work when
copied-and-pasted into an empty database, then simple and to-the-point
examples will be history. Instead of one-liners we'll have clutter.

regards, tom lane


From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:07:49
Message-ID: 937d27e10811240607q66bcfd1av14daddc4bca21d6f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 24, 2008 at 2:02 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Dave Page wrote:
>>> It might also be useful to create such a database at initdb time so
>>> newbies have something interesting to look at right away.
>
>> No, there is no need to clutter every installation in the world with
>> such a database. You could make it an addon module, or a pgfoundry project.
>
> The whole thing strikes me as extreme overkill, not to mention a
> misunderstanding of what an example is supposed to be for. If we're
> going to insist that every example in the docs work when
> copied-and-pasted into an empty database, then simple and to-the-point
> examples will be history. Instead of one-liners we'll have clutter.

That's the point of having a sample database ready to play with. The
docs needn't have clutter, but the user can try out any of the
examples without needing to setup anything first. It's a simple
usability tweak that can help ease the learning curve for new users.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Magnus Hagander" <magnus(at)hagander(dot)net>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:10:29
Message-ID: 937d27e10811240610i2e0dafb4n747c4662316c7220@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 24, 2008 at 2:01 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> Dave Page wrote:
>> That would defeat the point. Not that I have any great feelings either
>> way, but fwiw, Microsoft and Oracle both create a sample database
>> iirc.
>
> Last I checked, MS did it optionally only, no?

Yes, but it defaults on iirc. We can emulate that behaviour in an
installer (and do in Postgres Plus for example), but that doesn't help
users of other distributions.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dave Page" <dpage(at)pgadmin(dot)org>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:14:43
Message-ID: 17842.1227536083@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Dave Page" <dpage(at)pgadmin(dot)org> writes:
> On Mon, Nov 24, 2008 at 1:53 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> No, there is no need to clutter every installation in the world with such a
>> database. You could make it an addon module, or a pgfoundry project.

> That would defeat the point.

By that logic, we should install the sample stuff in template1, to
ensure that the examples would "just work" wherever $newbie tries
to execute them :-(

regards, tom lane


From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:21:52
Message-ID: 937d27e10811240621r1644db00s8905fd8c2ba86906@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 24, 2008 at 2:14 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Dave Page" <dpage(at)pgadmin(dot)org> writes:
>> On Mon, Nov 24, 2008 at 1:53 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>> No, there is no need to clutter every installation in the world with such a
>>> database. You could make it an addon module, or a pgfoundry project.
>
>> That would defeat the point.
>
> By that logic, we should install the sample stuff in template1, to
> ensure that the examples would "just work" wherever $newbie tries
> to execute them :-(

*sigh*. Or one of us could visit their office and show them what to
do, but I think we know the difference between making something usable
out of the box and going overboard.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:29:33
Message-ID: 20081124142933.GI23801@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

am Mon, dem 24.11.2008, um 9:02:37 -0500 mailte Tom Lane folgendes:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > Dave Page wrote:
> >> It might also be useful to create such a database at initdb time so
> >> newbies have something interesting to look at right away.
>
> > No, there is no need to clutter every installation in the world with
> > such a database. You could make it an addon module, or a pgfoundry project.
>
> The whole thing strikes me as extreme overkill, not to mention a
> misunderstanding of what an example is supposed to be for. If we're
> going to insist that every example in the docs work when
> copied-and-pasted into an empty database, then simple and to-the-point
> examples will be history. Instead of one-liners we'll have clutter.

For a beginner, a "relation 'foo' does not exist" is a clean message,
but a "function foo() does not exist" from an example in the doc are a real
problem. And, in this example in my first post, the call to the
nonexistent function are neither necessary nor 'to-the-point' to explain a
for-loop.

The starting point for my post was a real question on IRC today.
Someone was really confused because he tried to use this nonexistent
funktion to log something into a log-file. I think, this example can
rewritten, either without this funktion-call or with raise notice ...

Regards, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net


From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Dave Page" <dpage(at)pgadmin(dot)org>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 14:37:49
Message-ID: b42b73150811240637r52e21e1foabe62704ce737fdf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 24, 2008 at 9:02 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Dave Page wrote:
>>> It might also be useful to create such a database at initdb time so
>>> newbies have something interesting to look at right away.
>
>> No, there is no need to clutter every installation in the world with
>> such a database. You could make it an addon module, or a pgfoundry project.
>
> The whole thing strikes me as extreme overkill, not to mention a
> misunderstanding of what an example is supposed to be for. If we're
> going to insist that every example in the docs work when
> copied-and-pasted into an empty database, then simple and to-the-point
> examples will be history. Instead of one-liners we'll have clutter.

Clutter is the problem. The cs_log functions in the example do not
serve any purpose that is helpful to describe a for loop. They serve
no real purpose...why not 'raise notice' or just remove them? It
should be clear to distinguish from real and non-real elements.

merlin


From: "Robert Haas" <robertmhaas(at)gmail(dot)com>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Dave Page" <dpage(at)pgadmin(dot)org>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 15:04:01
Message-ID: 603c8f070811240704y285eeaacn4c34b82c713ab9b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> Clutter is the problem. The cs_log functions in the example do not
> serve any purpose that is helpful to describe a for loop. They serve
> no real purpose...why not 'raise notice' or just remove them? It
> should be clear to distinguish from real and non-real elements.

+1 for RAISE NOTICE.

...Robert


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: "Dave Page" <dpage(at)pgadmin(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-24 17:00:02
Message-ID: 200811241900.04192.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Monday 24 November 2008 16:07:49 Dave Page wrote:
> That's the point of having a sample database ready to play with. The
> docs needn't have clutter, but the user can try out any of the
> examples without needing to setup anything first. It's a simple
> usability tweak that can help ease the learning curve for new users.

I find that the regression test database usually works for that.


From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: "Dave Page" <dpage(at)pgadmin(dot)org>, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 01:42:13
Message-ID: 200811242042.13879.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Monday 24 November 2008 09:10:29 Dave Page wrote:
> On Mon, Nov 24, 2008 at 2:01 PM, Magnus Hagander <magnus(at)hagander(dot)net>
wrote:
> > Dave Page wrote:
> >> That would defeat the point. Not that I have any great feelings either
> >> way, but fwiw, Microsoft and Oracle both create a sample database
> >> iirc.
> >
> > Last I checked, MS did it optionally only, no?
>
> Yes, but it defaults on iirc. We can emulate that behaviour in an
> installer (and do in Postgres Plus for example), but that doesn't help
> users of other distributions.
>

We actually have such a database on pgfoundry already
(http://pgfoundry.org/frs/download.php/1719/pagila-0.10.1.zip), which i think
devrim may have packaged into an rpm; it wouldn't hurt to add it to the win32
installer, but would you feel better if it were a contrib module or
something?

--
Robert Treat
Conjecture: http://www.xzilla.net
Consulting: http://www.omniti.com


From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Robert Treat" <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 08:31:02
Message-ID: 937d27e10811250031q483e8adfw5e2731b574f5734c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 25, 2008 at 1:42 AM, Robert Treat
<xzilla(at)users(dot)sourceforge(dot)net> wrote:
>
> We actually have such a database on pgfoundry already
> (http://pgfoundry.org/frs/download.php/1719/pagila-0.10.1.zip), which i think
> devrim may have packaged into an rpm; it wouldn't hurt to add it to the win32
> installer, but would you feel better if it were a contrib module or
> something?

I'm in favour of including it by default (at initdb), so it's there
for new users to play with on any fresh install - however, there is
only a point to that if all the documentation examples are based on
that database to allow copy-paste-play.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 09:23:35
Message-ID: 20081125092335.GA7395@cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dave Page wrote:
>On Tue, Nov 25, 2008 at 1:42 AM, Robert Treat
><xzilla(at)users(dot)sourceforge(dot)net> wrote:

>> We actually have such a database on pgfoundry already
>> (http://pgfoundry.org/frs/download.php/1719/pagila-0.10.1.zip), which i think
>> devrim may have packaged into an rpm; it wouldn't hurt to add it to the win32
>> installer, but would you feel better if it were a contrib module or
>> something?

>I'm in favour of including it by default (at initdb), so it's there
>for new users to play with on any fresh install - however, there is

+1

It's reasonably easy to create a sample database during the initdb phase
automatically. It's rather easy for an experienced DBA to "dropdb sampledb"
to get rid of it, and it would be orders of magnitude more difficult for
a novice to create the sample database from contrib or anywhere else.
Besides the "waste" of space for the sample database should be negligible for
almost any real production environment.

>only a point to that if all the documentation examples are based on
>that database to allow copy-paste-play.

True. Though this is a chicken and egg problem, by simply creating the
sample DB first, it creates the opportunity to gradually convert all examples
in the manual to use the sample DB (and patch the sample DB in the process to
be populated with the proper tables/functions to actually be useful in
the required examples).
--
Sincerely,
Stephen R. van den Berg.
"Give a man a fire and he's warm for a day,
but set fire to him and he's warm for the rest of his life."


From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Dave Page" <dpage(at)pgadmin(dot)org>
Cc: "Robert Treat" <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 11:31:10
Message-ID: 37ed240d0811250331s7d2148ack78e8c8658622e84b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 25, 2008 at 7:31 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> I'm in favour of including it by default (at initdb), so it's there
> for new users to play with on any fresh install ...

Could we perhaps punt on the issue of whether to install the
"sampledb" by default. It could be controlled by a flag to initdb,
say

$ initdb --sample data

Whereas if you omit the flag, then initdb just does a vanilla install.
Then we can leave it up to the distributions whether they want to
install it by default, or give the user options in their package
management systems to control this. In Apt it could be a debconf
question, in Portage it could be a USE flag, etc.

I think it's a pretty safe bet that the "newbies" we're talking about
in this thread are going to be installing postgres via a package
management system. If they are installing from source, they are
already reading the documentation and will have to learn about running
initdb on the command line anyway.

Cheers,
BJ


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dave Page" <dpage(at)pgadmin(dot)org>
Cc: "Robert Treat" <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 13:23:57
Message-ID: 14771.1227619437@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Dave Page" <dpage(at)pgadmin(dot)org> writes:
> I'm in favour of including it by default (at initdb), so it's there
> for new users to play with on any fresh install - however, there is
> only a point to that if all the documentation examples are based on
> that database to allow copy-paste-play.

You would also have to assume that all the examples are non-destructive,
and that no one ever extends an example in a destructive way. This
seems like a non-starter. Better to provide the sample database in a
form in which it can be easily dropped/reloaded. I'm envisioning that
there's a source file in $sharedir and we tell people

createdb example
psql -f $sharedir/example.sql example

regards, tom lane


From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Robert Treat" <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 13:32:44
Message-ID: 937d27e10811250532q13c7b02fh15958615dab2e645@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 25, 2008 at 1:23 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Dave Page" <dpage(at)pgadmin(dot)org> writes:
>> I'm in favour of including it by default (at initdb), so it's there
>> for new users to play with on any fresh install - however, there is
>> only a point to that if all the documentation examples are based on
>> that database to allow copy-paste-play.
>
> You would also have to assume that all the examples are non-destructive,
> and that no one ever extends an example in a destructive way.

That's a good point.

> This
> seems like a non-starter. Better to provide the sample database in a
> form in which it can be easily dropped/reloaded. I'm envisioning that
> there's a source file in $sharedir and we tell people
>
> createdb example
> psql -f $sharedir/example.sql example

I was assuming that it would be in such a form anyway - similar to
system_views.sql for example. I'd be happy with that setup - it's far
better than referring people to pgFoundry, and should be simple for
anyone to use.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Dave Page" <dpage(at)pgadmin(dot)org>, "Robert Treat" <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 14:16:19
Message-ID: b42b73150811250616x45fa2076yfbd1026dcd9ee9c7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 25, 2008 at 8:23 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Dave Page" <dpage(at)pgadmin(dot)org> writes:
>> I'm in favour of including it by default (at initdb), so it's there
>> for new users to play with on any fresh install - however, there is
>> only a point to that if all the documentation examples are based on
>> that database to allow copy-paste-play.
>
> You would also have to assume that all the examples are non-destructive,
> and that no one ever extends an example in a destructive way. This
> seems like a non-starter. Better to provide the sample database in a
> form in which it can be easily dropped/reloaded. I'm envisioning that
> there's a source file in $sharedir and we tell people
>
> createdb example
> psql -f $sharedir/example.sql example

There's good precedent for that...SQL Server for example does something similar:
http://msdn.microsoft.com/en-us/library/aa276825(SQL.80).aspx

It's a good learning tool and would really raise the value of the documentation.

merlin


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 14:17:42
Message-ID: 492C0906.4090106@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Better to provide the sample database in a
> form in which it can be easily dropped/reloaded. I'm envisioning that
> there's a source file in $sharedir and we tell people
>
> createdb example
> psql -f $sharedir/example.sql example
>
>
>

This is a much better idea than doing it at initdb time, IMNSHO.

cheers

andrew


From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 19:29:27
Message-ID: 492C5217.2060102@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Stephen R. van den Berg wrote:
> ... it would be orders of magnitude more difficult for
> a novice to create the sample database from contrib or anywhere else.

It seems to me that *this* is the more serious problem that
we should fix instead.

If, from the psql command prompt I could type:

psql=# install module sampledb;
Downloading sampledb from pgfoundry...
Installing sampledb....
Connecting to sampledb....
sampledb=#

it'd remove the need for pre-installing a rarely-needed ad-on,
as well as being useful for other projects. For exmaple:
psql=# install module US_Census_Tiger_Maps;
Installing dependency Postgis...
Installing module US_Census_Tiger_Maps....
to install a GIS system with all the road networks.


From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 20:56:42
Message-ID: 8145EDD2-9B48-419B-B677-3D83CD125437@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Le 25 nov. 08 à 20:29, Ron Mayer a écrit :
> psql=# install module sampledb;
> Downloading sampledb from pgfoundry...
> Installing sampledb....
> Connecting to sampledb....
> sampledb=#

This could be part of an installer for PostgreSQL extensions. See
following email for a proposal on how to deal with extension packaging:
http://archives.postgresql.org/pgsql-hackers/2008-07/msg01098.php

The proposal purposefully let fetching and building steps out of the
database manager itself, and makes it so that building is to be cared
about by distributors. So it would be something like:
create sampledb
pg_pkg fetch pgsampledb

and either
pg_pkg install pgsampledb sampledb
psql sampledb
or
psql sampledb
sampledb=# install package pgsampledb;

> it'd remove the need for pre-installing a rarely-needed ad-on,
> as well as being useful for other projects. For exmaple:
> psql=# install module US_Census_Tiger_Maps;
> Installing dependency Postgis...
> Installing module US_Census_Tiger_Maps....
> to install a GIS system with all the road networks.

The dependancy system is yet to be though about, but definitely in the
scope of the extension manager.

While at it, calling all those things extensions rather than package
would probably help not confusing people with Oracle compatibility
etc. Last time I checked I didn't find mention of "package" into the
standard, but still.

So PosgtreSQL could have an extension manager at SQL level (create or
replace extension, install extension, or maybe load extension (which
would LOAD the modules associated), etc) with a system command line
tool to fetch & build, etc (pg_ext ?) that source level users and
packagers (distributors) would use?

What do you dear readers think about the "extension" vocabulary?

Regards,
- --
dim

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkksZooACgkQlBXRlnbh1bmyvgCaAobd8kWhtkO+DxmDjbnqAWCz
5pQAoMauBWbyuvYxg6bDndYpb9CYiYZc
=Reeq
-----END PGP SIGNATURE-----


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-25 21:46:39
Message-ID: 6601.1227649599@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dimitri Fontaine <dfontaine(at)hi-media(dot)com> writes:
> What do you dear readers think about the "extension" vocabulary?

+1 ... we should stay away from "package" unless we are going to
implement an Oracle-compatible facility. Which I don't particularly
wish to do, but we should leave it open for the future.

regards, tom lane


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: blatantly a bug in the documentation
Date: 2008-11-27 19:38:23
Message-ID: 1227814703.20796.113.camel@hp_dx2400_1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Tue, 2008-11-25 at 08:23 -0500, Tom Lane wrote:
> "Dave Page" <dpage(at)pgadmin(dot)org> writes:
> > I'm in favour of including it by default (at initdb), so it's there
> > for new users to play with on any fresh install - however, there is
> > only a point to that if all the documentation examples are based on
> > that database to allow copy-paste-play.
>
> You would also have to assume that all the examples are non-destructive,
> and that no one ever extends an example in a destructive way. This
> seems like a non-starter. Better to provide the sample database in a
> form in which it can be easily dropped/reloaded. I'm envisioning that
> there's a source file in $sharedir and we tell people
>
> createdb example
> psql -f $sharedir/example.sql example

Sounds good.

Please could we do this in a way that allows the example database to be
localised. It will help beginners understand things better if we have
table and column names in the local language. One more thing to
translate maybe, but lets leave the door open for localisation.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support