0

I want to generate a ER Diagram sort of, of my spatial database i created inside of Postgresql. As i am also new to Postgresql, i am not too sure if the diagramming functionality can be done using whats offered by the PgAdmin (not referring to the Graphical Query Builder). However, it seems to me there is none. I read around that there is a perl based tool called postgresql_autodoc that can run through PostgreSQL system tables and return HTML, Dot, Dia and DocBook XML which describes the database. Now this is not exactly what i wanted but its the closest option i have. So i have successfully installed, ActivePerl 5.8 and DBD-Pg 2.10.0 for Perl 5.8 (DBD PG is a Perl DBI driver for the PostgreSQL database) and i have also downloaded the postgresql_autodoc.pl file. I have also added the path for Perl. But when i try to run the postgresql_autodoc.pl via the command prompt, i was getting this error: Possible Unintended Interpolation of @TEMPLATE in string at C:/Perl/bin/postgresql_autodoc.pl line 1831. Global symbol "@TEMPLATE" requires explicit package name at C:/Perl/bin/postgresql_autodoc.pl line 1831. Execution of C:/Perl/bin/postgresql_autodoc.pl aborted due to compilation errors.

I tried to view the postgresql_autodoc.pl using notepad++ however i have no experience with the perl language and so i cant figure out what is really wrong. All i could do is locate line 1831 but i dont know what i should do to fix this problem.

The postgresql_autodoc.pl file was downloaded from: http://www.rbt.ca/autodoc/

I would appreciate if anyone can help me here!

Thanks in advance

Barbara

Barbara Lokes
  • 31
  • 1
  • 1
  • 3

1 Answers1

2

That thingy, @@TEMPLATE-DIR@@, is a string that is replaced when you build and install the module -- meaning you're not supposed to run it directly from the unpacked archive.

Most Perl modules are installed with a more or less simple three-step installation process, something like perl Makefile.PL ; make ; make install. However, this package is slightly different, you seem only to need make install.

Note that I have no experience with installing Perl modules on Windows with ActiveState. So the above may not work (e.g. if there's no make utility which is usually not part of Perl -- though it might be part of the ActiveState Perl distribution).

But there's a workaround. You can simply do what the install script does and replace the @@TEMPLATE-DIR@@ string yourself. It can be done easily with any text editor by replacing the two occurrences of @@TEMPLATE-DIR@@ with the path to where the postgresql_autodoc.pl script has been unpacked to -- meaning it's the path the script will look for the *.tmpl files in.

Note that Windows path names can be written with forward slashes in Perl, meaning C:/Temp/postgresql_autodoc should be OK.

Moritz Bunkus
  • 11,592
  • 3
  • 37
  • 49
  • Thanks so much Moritz for your response. I did as you suggested and when i ran the postgresql_autodoc.pl, i got a new error message saying: The procedure entry point Per_sv_2iv_flags could not be located in the dynamic link library perl58.dll. This error message was displayed as a pop-up. However the error message on the command prompt says that: Cant locate PAR/Dist.pm in @INC (@INC contains C:/Perl/lib C:/Perl/site/lib.). Any light on this one as well? – Barbara Lokes Nov 20 '12 at 21:46
  • That I honestly have no clue about. Maybe you've got more than one instance of perl58.dll lying around, or you've got some Perl modules installed that were compiled with different versions of Perl. How to solve all that? No idea. One thing you could do is installing Linux in a virtual machine (http://www.virtualbox.org is a free virtualizer) and try to get the script to install and run there. Perl support is first class in most (all?) Linux distros, and getting scripts to run there can be a ton easier than on Windows. – Moritz Bunkus Nov 21 '12 at 08:14