Thread: BUG #5250: Tutorial examples(pre-compiled) not present with precompiled binary version of PostgreSQL.

The following bug has been logged online:

Bug reference:      5250
Logged by:          Ashish Anand
Email address:      Ashish.The.Dev@Gmail.com
PostgreSQL version: 8.4.1
Operating system:   Windows 7
Description:        Tutorial examples(pre-compiled) not present with
precompiled binary version of PostgreSQL.
Details:

postgresql-8.4.chm mentions that:
If you installed a pre-packaged version of PostgreSQL rather than building
from source, look for a directory named tutorial within the PostgreSQL
distribution. The “make” part should already have been done for you.

However, no such tutorial directory exists for following version
                           version
-------------------------------------------------------------
 PostgreSQL 8.4.1, compiled by Visual C++ build 1400, 32-bit


Thanks,
Ashish.
On Thu, Dec 17, 2009 at 4:06 PM, Ashish Anand <Ashish.The.Dev@gmail.com> wr=
ote:
>
> The following bug has been logged online:
>
> Bug reference: =A0 =A0 =A05250
> Logged by: =A0 =A0 =A0 =A0 =A0Ashish Anand
> Email address: =A0 =A0 =A0Ashish.The.Dev@Gmail.com
> PostgreSQL version: 8.4.1
> Operating system: =A0 Windows 7
> Description: =A0 =A0 =A0 =A0Tutorial examples(pre-compiled) not present w=
ith
> precompiled binary version of PostgreSQL.
> Details:
>
> postgresql-8.4.chm mentions that:
> If you installed a pre-packaged version of PostgreSQL rather than building
> from source, look for a directory named tutorial within the PostgreSQL
> distribution. The =93make=94 part should already have been done for you.
>
> However, no such tutorial directory exists for following version
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 version
> -------------------------------------------------------------
> =A0PostgreSQL 8.4.1, compiled by Visual C++ build 1400, 32-bit
>
>
> Thanks,
> Ashish.

Where did you download the installer in question?  Obviously we don't
have control over what individual packagers may choose to do, although
if the package in question was produced by us then you might have a
point.  :-)

...Robert
Hi,

I downloaded from here
http://www.postgresql.org/download/windows
<http://www.postgresql.org/download/windows>which leads to
http://www.enterprisedb.com/products/pgdownload.do#windows
and has a note:
*The one click installer is maintained by Dave Page at
EnterpriseDB<http://www.enterprisedb.com/>
.*

Also the documentation says:
Before you report a bug, please read and re-read the documentation to verify
that you can really do whatever it is you are trying. If it is not clear
from the documentation whether you can do something or not, please report
that too; it is a bug in the documentation.

Thanks,
Ashish.

On Mon, Dec 21, 2009 at 7:16 AM, Robert Haas <robertmhaas@gmail.com> wrote:

> On Thu, Dec 17, 2009 at 4:06 PM, Ashish Anand <Ashish.The.Dev@gmail.com>
> wrote:
> >
> > The following bug has been logged online:
> >
> > Bug reference:      5250
> > Logged by:          Ashish Anand
> > Email address:      Ashish.The.Dev@Gmail.com
> > PostgreSQL version: 8.4.1
> > Operating system:   Windows 7
> > Description:        Tutorial examples(pre-compiled) not present with
> > precompiled binary version of PostgreSQL.
> > Details:
> >
> > postgresql-8.4.chm mentions that:
> > If you installed a pre-packaged version of PostgreSQL rather than
> building
> > from source, look for a directory named tutorial within the PostgreSQL
> > distribution. The =93make=94 part should already have been done for you.
> >
> > However, no such tutorial directory exists for following version
> >                           version
> > -------------------------------------------------------------
> >  PostgreSQL 8.4.1, compiled by Visual C++ build 1400, 32-bit
> >
> >
> > Thanks,
> > Ashish.
>
> Where did you download the installer in question?  Obviously we don't
> have control over what individual packagers may choose to do, although
> if the package in question was produced by us then you might have a
> point.  :-)
>
> ...Robert
>
On Mon, Dec 21, 2009 at 7:05 AM, Ashish Anand <Ashish.The.Dev@gmail.com> wr=
ote:
> Hi,
> I downloaded from here
> http://www.postgresql.org/download/windows
> which leads to
> http://www.enterprisedb.com/products/pgdownload.do#windows
> and has a note:
> The one click installer is maintained by Dave Page at=A0EnterpriseDB.
>
> Also the documentation says:
> Before you report a bug, please read and re-read the documentation to ver=
ify
> that you can really do whatever it is you are trying. If it is not clear
> from the documentation whether you can do something or not, please report
> that too; it is a bug in the documentation.

It's fine that you reported a bug - I'm not complaining.  But, the
installer you used is not a community product, but rather something
maintained by EnterpriseDB, so we don't necessarily have control over
it.  However, I do know that several EDB folks, including I believe
Dave Page, read this list, so perhaps one of them will see fit to
comment.

...Robert
On Tue, Dec 22, 2009 at 3:13 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Mon, Dec 21, 2009 at 7:05 AM, Ashish Anand <Ashish.The.Dev@gmail.com> =
wrote:
>> Hi,
>> I downloaded from here
>> http://www.postgresql.org/download/windows
>> which leads to
>> http://www.enterprisedb.com/products/pgdownload.do#windows
>> and has a note:
>> The one click installer is maintained by Dave Page at=A0EnterpriseDB.
>>
>> Also the documentation says:
>> Before you report a bug, please read and re-read the documentation to ve=
rify
>> that you can really do whatever it is you are trying. If it is not clear
>> from the documentation whether you can do something or not, please report
>> that too; it is a bug in the documentation.
>
> It's fine that you reported a bug - I'm not complaining. =A0But, the
> installer you used is not a community product, but rather something
> maintained by EnterpriseDB, so we don't necessarily have control over
> it. =A0However, I do know that several EDB folks, including I believe
> Dave Page, read this list, so perhaps one of them will see fit to
> comment.

He does, but he's been on leave and not paying much attention to the lists.

In 12 years of working with PG, I never noticed that directory
required building manually (which is why it's not it any installer
from EDB, or the community). Is there any reason for that?


--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
Well, I hope he does.

Thanks by the way.

--Ashish.

On Tue, Dec 22, 2009 at 8:43 AM, Robert Haas <robertmhaas@gmail.com> wrote:

> On Mon, Dec 21, 2009 at 7:05 AM, Ashish Anand <Ashish.The.Dev@gmail.com>
> wrote:
> > Hi,
> > I downloaded from here
> > http://www.postgresql.org/download/windows
> > which leads to
> > http://www.enterprisedb.com/products/pgdownload.do#windows
> > and has a note:
> > The one click installer is maintained by Dave Page at EnterpriseDB.
> >
> > Also the documentation says:
> > Before you report a bug, please read and re-read the documentation to
> verify
> > that you can really do whatever it is you are trying. If it is not clear
> > from the documentation whether you can do something or not, please report
> > that too; it is a bug in the documentation.
>
> It's fine that you reported a bug - I'm not complaining.  But, the
> installer you used is not a community product, but rather something
> maintained by EnterpriseDB, so we don't necessarily have control over
> it.  However, I do know that several EDB folks, including I believe
> Dave Page, read this list, so perhaps one of them will see fit to
> comment.
>
> ...Robert
>
Actually its not critical for Postgres but I was going through the tutorial
in the Postgres .chm help file where this directory was mentioned.
And it specifically said "If you installed a pre-packaged version of
PostgreSQL"(see the first mail) which made it look like a bug.

Nevertheless, I have downloaded the source and I got the tutorial directory.
I just thought someone else might not have to go through all the trouble so
I posted a mail.

--Ashish.

On Tue, Dec 22, 2009 at 2:53 PM, Dave Page <dpage@pgadmin.org> wrote:

> On Tue, Dec 22, 2009 at 3:13 AM, Robert Haas <robertmhaas@gmail.com>
> wrote:
> > On Mon, Dec 21, 2009 at 7:05 AM, Ashish Anand <Ashish.The.Dev@gmail.com>
> wrote:
> >> Hi,
> >> I downloaded from here
> >> http://www.postgresql.org/download/windows
> >> which leads to
> >> http://www.enterprisedb.com/products/pgdownload.do#windows
> >> and has a note:
> >> The one click installer is maintained by Dave Page at EnterpriseDB.
> >>
> >> Also the documentation says:
> >> Before you report a bug, please read and re-read the documentation to
> verify
> >> that you can really do whatever it is you are trying. If it is not clear
> >> from the documentation whether you can do something or not, please
> report
> >> that too; it is a bug in the documentation.
> >
> > It's fine that you reported a bug - I'm not complaining.  But, the
> > installer you used is not a community product, but rather something
> > maintained by EnterpriseDB, so we don't necessarily have control over
> > it.  However, I do know that several EDB folks, including I believe
> > Dave Page, read this list, so perhaps one of them will see fit to
> > comment.
>
> He does, but he's been on leave and not paying much attention to the lists.
>
> In 12 years of working with PG, I never noticed that directory
> required building manually (which is why it's not it any installer
> from EDB, or the community). Is there any reason for that?
>
>
> --
> Dave Page
> EnterpriseDB UK: http://www.enterprisedb.com
>
Dave Page <dpage@pgadmin.org> writes:
> In 12 years of working with PG, I never noticed that directory
> required building manually (which is why it's not it any installer
> from EDB, or the community). Is there any reason for that?

To judge from the RPM examples, you'd probably need special actions
anyway.  The RPMs need to change the installed path.  I have these
steps in the Fedora/Red Hat specfile:

# Have to hack makefile to put correct path into tutorial scripts
sed "s|C=\`pwd\`;|C=%{_libdir}/pgsql/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile
make %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all
rm -f src/tutorial/GNUmakefile

install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
cp src/tutorial/* $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial

It looks to me like the unmodified Makefile builds the .sql files
on the assumption they will be used *in the source tree*.  So basically
no installer could use that as-is anyway.

            regards, tom lane
On Tue, Dec 22, 2009 at 3:30 PM, Ashish Anand <Ashish.The.Dev@gmail.com> wrote:
> Just to make it clear, if it wasn't apparent already, my operating system is
> Windows 7.

I'm pretty sure the MSVC build system doesn't even know about the
tutorial directory, so we'd need to fix that before any installer
changes were made.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
Just to make it clear, if it wasn't apparent already, my operating system is
Windows 7.

--Ashish.

On Tue, Dec 22, 2009 at 8:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Dave Page <dpage@pgadmin.org> writes:
> > In 12 years of working with PG, I never noticed that directory
> > required building manually (which is why it's not it any installer
> > from EDB, or the community). Is there any reason for that?
>
> To judge from the RPM examples, you'd probably need special actions
> anyway.  The RPMs need to change the installed path.  I have these
> steps in the Fedora/Red Hat specfile:
>
> # Have to hack makefile to put correct path into tutorial scripts
> sed "s|C=\`pwd\`;|C=%{_libdir}/pgsql/tutorial;|" < src/tutorial/Makefile >
> src/tutorial/GNUmakefile
> make %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all
> rm -f src/tutorial/GNUmakefile
>
> install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
> cp src/tutorial/* $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
>
> It looks to me like the unmodified Makefile builds the .sql files
> on the assumption they will be used *in the source tree*.  So basically
> no installer could use that as-is anyway.
>
>                        regards, tom lane
>
Tom Lane escribió:

> # Have to hack makefile to put correct path into tutorial scripts
> sed "s|C=\`pwd\`;|C=%{_libdir}/pgsql/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile
> make %{?_smp_mflags} -C src/tutorial NO_PGXS=1 all
> rm -f src/tutorial/GNUmakefile
>
> install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
> cp src/tutorial/* $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
>
> It looks to me like the unmodified Makefile builds the .sql files
> on the assumption they will be used *in the source tree*.  So basically
> no installer could use that as-is anyway.

Sounds like something that should be fixed upstream, if someone is
sufficiently interested.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Sorry your tenses were a bit jumbled up in last response. Couldn't make out
what was past and what will be future action.
But in short seems like you/someone is going to make the fix pretty soon? Am
I right here?

But regardless, please open a bug in your bug tracking database so that it
doesn't get lost in mails.

Thanks.
--Ashish.

On Tue, Dec 22, 2009 at 9:08 PM, Dave Page <dpage@pgadmin.org> wrote:

> On Tue, Dec 22, 2009 at 3:30 PM, Ashish Anand <Ashish.The.Dev@gmail.com>
> wrote:
> > Just to make it clear, if it wasn't apparent already, my operating system
> is
> > Windows 7.
>
> I'm pretty sure the MSVC build system doesn't even know about the
> tutorial directory, so we'd need to fix that before any installer
> changes were made.
>
> --
> Dave Page
> EnterpriseDB UK: http://www.enterprisedb.com
>
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane escribió:
>> It looks to me like the unmodified Makefile builds the .sql files
>> on the assumption they will be used *in the source tree*.  So basically
>> no installer could use that as-is anyway.

> Sounds like something that should be fixed upstream, if someone is
> sufficiently interested.

First thing we'd have to figure out is what behavior we want instead.
There are at least two places in the manual that actually say these
files are in the source tree, so it's not just a minor coding detail.

(In fact, I think at least part of the intention is to have the user
learn how to build functions from source, so possibly the right question
to ask is why *should* these be shipped in binary builds?)

            regards, tom lane
Ashish Anand escribió:
> I think they just have to be there. Preferably in the form of raw code - as
> documentation mentions.

Feel free to propose a patch!

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Ashish Anand escribió:
> I thought enterprise db wasn't open-source. Is it?
> Give me a link please. I'll give the patch.

Some of its products are (EDB is a company), but here we're talking
about PostgreSQL which definitely is open source.  You can find the
source code here:


http://git.postgresql.org/gitweb?p=postgresql.git;a=tree;f=src/tutorial;h=4f670a9824d630444d46c7a82baf253b0da1e163;hb=HEAD

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
I think they just have to be there. Preferably in the form of raw code - as
documentation mentions.

--Ashish.

On Wed, Dec 23, 2009 at 1:23 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Tom Lane escribi=F3:
> >> It looks to me like the unmodified Makefile builds the .sql files
> >> on the assumption they will be used *in the source tree*.  So basically
> >> no installer could use that as-is anyway.
>
> > Sounds like something that should be fixed upstream, if someone is
> > sufficiently interested.
>
> First thing we'd have to figure out is what behavior we want instead.
> There are at least two places in the manual that actually say these
> files are in the source tree, so it's not just a minor coding detail.
>
> (In fact, I think at least part of the intention is to have the user
> learn how to build functions from source, so possibly the right question
> to ask is why *should* these be shipped in binary builds?)
>
>                        regards, tom lane
>
I thought enterprise db wasn't open-source. Is it?
Give me a link please. I'll give the patch.

On Wed, Dec 23, 2009 at 1:44 AM, Alvaro Herrera
<alvherre@commandprompt.com>wrote:

> Ashish Anand escribi=F3:
> > I think they just have to be there. Preferably in the form of raw code -
> as
> > documentation mentions.
>
> Feel free to propose a patch!
>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
Just to be clear - link for source code enlistment of enterprise db.

On Wed, Dec 23, 2009 at 1:46 AM, Ashish Anand <Ashish.The.Dev@gmail.com>wro=
te:

> I thought enterprise db wasn't open-source. Is it?
> Give me a link please. I'll give the patch.
>
>
> On Wed, Dec 23, 2009 at 1:44 AM, Alvaro Herrera <
> alvherre@commandprompt.com> wrote:
>
>> Ashish Anand escribi=F3:
>> > I think they just have to be there. Preferably in the form of raw code=
 -
>> as
>> > documentation mentions.
>>
>> Feel free to propose a patch!
>>
>> --
>> Alvaro Herrera
>> http://www.CommandPrompt.com/
>> The PostgreSQL Company - Command Prompt, Inc.
>>
>
>
On Tue, Dec 22, 2009 at 8:43 PM, Ashish Anand <Ashish.The.Dev@gmail.com> wr=
ote:
> Alvaro, Please read the=A0first=A0three mails in this thread.
>
> Dave, can you open a bug at your end. Just open it so that it can be trac=
ked
> two months down the line. I am not insisting on fixing it right now.

There is nothing to fix at 'my end' at the moment (whichever end you
consider that to be). As has been established in the later messages in
the thread, the tutorial isn't built at all by the PostgreSQL MSVC
build system, and on other platforms the installation location is
fixed. As Tom as pointed out, we first need to determine we want it to
work, and then apply the appropriate fix to PostgreSQL. Only then will
the downstream packages make any changes, should they be required.

My vote is to reword the docs so they don't say that binary distros
will include the pre-built tutorial binaries, and then we can consider
shipping the source files in the installers/rpms etc.

--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
On Tue, Dec 22, 2009 at 9:03 PM, Ashish Anand <Ashish.The.Dev@gmail.com> wrote:
> Fine. Whatever suits you. I guess there is only so much I can do through
> e-mails as an end user. I was just trying not to drop the ball and do a
> positive handover.

Don't worry - we appreciate the bug report, and are not in the habit
of ignoring them, or dropping the ball.

Thanks, Dave.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
Alvaro, Please read the first three mails in this thread.

Dave, can you open a bug at your end. Just open it so that it can be tracked
two months down the line. I am not insisting on fixing it right now.

--Ashish.

On Wed, Dec 23, 2009 at 1:49 AM, Alvaro Herrera
<alvherre@commandprompt.com>wrote:

> Ashish Anand escribi=F3:
> > I thought enterprise db wasn't open-source. Is it?
> > Give me a link please. I'll give the patch.
>
> Some of its products are (EDB is a company), but here we're talking
> about PostgreSQL which definitely is open source.  You can find the
> source code here:
>
>
> http://git.postgresql.org/gitweb?p=3Dpostgresql.git;a=3Dtree;f=3Dsrc/tuto=
rial;h=3D4f670a9824d630444d46c7a82baf253b0da1e163;hb=3DHEAD
>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
Fine. Whatever suits you. I guess there is only so much I can do through
e-mails as an end user. I was just trying not to drop the ball and do a
positive handover.
Thanks anyways.

--Ashish.

On Wed, Dec 23, 2009 at 2:28 AM, Dave Page <dpage@pgadmin.org> wrote:

> On Tue, Dec 22, 2009 at 8:43 PM, Ashish Anand <Ashish.The.Dev@gmail.com>
> wrote:
> > Alvaro, Please read the first three mails in this thread.
> >
> > Dave, can you open a bug at your end. Just open it so that it can be
> tracked
> > two months down the line. I am not insisting on fixing it right now.
>
> There is nothing to fix at 'my end' at the moment (whichever end you
> consider that to be). As has been established in the later messages in
> the thread, the tutorial isn't built at all by the PostgreSQL MSVC
> build system, and on other platforms the installation location is
> fixed. As Tom as pointed out, we first need to determine we want it to
> work, and then apply the appropriate fix to PostgreSQL. Only then will
> the downstream packages make any changes, should they be required.
>
> My vote is to reword the docs so they don't say that binary distros
> will include the pre-built tutorial binaries, and then we can consider
> shipping the source files in the installers/rpms etc.
>
> --
> Dave Page
> EnterpriseDB UK: http://www.enterprisedb.com
>
Dave Page wrote:
> On Tue, Dec 22, 2009 at 8:43 PM, Ashish Anand <Ashish.The.Dev@gmail.com> wrote:
> > Alvaro, Please read the?first?three mails in this thread.
> >
> > Dave, can you open a bug at your end. Just open it so that it can be tracked
> > two months down the line. I am not insisting on fixing it right now.
>
> There is nothing to fix at 'my end' at the moment (whichever end you
> consider that to be). As has been established in the later messages in
> the thread, the tutorial isn't built at all by the PostgreSQL MSVC
> build system, and on other platforms the installation location is
> fixed. As Tom as pointed out, we first need to determine we want it to
> work, and then apply the appropriate fix to PostgreSQL. Only then will
> the downstream packages make any changes, should they be required.
>
> My vote is to reword the docs so they don't say that binary distros
> will include the pre-built tutorial binaries, and then we can consider
> shipping the source files in the installers/rpms etc.

I have applied the attached patch which removes the mention that the
tutorial files are precompiled.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/query.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/query.sgml,v
retrieving revision 1.53
diff -c -c -r1.53 query.sgml
*** doc/src/sgml/query.sgml    17 Jun 2009 21:58:49 -0000    1.53
--- doc/src/sgml/query.sgml    19 Feb 2010 01:14:45 -0000
***************
*** 26,32 ****
     <para>
      Examples in this manual can also be found in the
      <productname>PostgreSQL</productname> source distribution
!     in the directory <filename>src/tutorial/</filename>.  To use those
      files, first change to that directory and run <application>make</>:

  <screen>
--- 26,34 ----
     <para>
      Examples in this manual can also be found in the
      <productname>PostgreSQL</productname> source distribution
!     in the directory <filename>src/tutorial/</filename>.  (Binary
!     distributions of <productname>PostgreSQL</productname> might not
!     compile these files.)  To use those
      files, first change to that directory and run <application>make</>:

  <screen>
***************
*** 35,46 ****
  </screen>

      This creates the scripts and compiles the C files containing user-defined
!     functions and types.  (If you installed a pre-packaged version of
!     <productname>PostgreSQL</productname> rather than building from source,
!     look for a directory named <filename>tutorial</> within the
!     <productname>PostgreSQL</productname> distribution.  The <quote>make</>
!     part should already have been done for you.)
!     Then, to start the tutorial, do the following:

  <screen>
  <prompt>$</prompt> <userinput>cd <replaceable>....</replaceable>/tutorial</userinput>
--- 37,43 ----
  </screen>

      This creates the scripts and compiles the C files containing user-defined
!     functions and types.  Then, to start the tutorial, do the following:

  <screen>
  <prompt>$</prompt> <userinput>cd <replaceable>....</replaceable>/tutorial</userinput>