[From nobody Thu Feb 20 16:41:04 2003 Date: Wed, 19 Dec 2001 19:47:18 +0100 From: Bernhard Reiter <bernhard@intevation.de> To: postgis@yahoogroups.com Subject: Doc patch: creatlang plpgsal Message-ID: <20011219194718.Q7111@intevation.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hSZb4FHl1C2xfsUy" Content-Disposition: inline User-Agent: Mutt/1.3.22.1i --hSZb4FHl1C2xfsUy Content-Type: multipart/mixed; boundary="GIP5y49pbaVPin6k" Content-Disposition: inline --GIP5y49pbaVPin6k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello everybody, looks like we will use PostGIS for a project and I am right now diving into it. Found a little inacuracy in the documentation, patch attached. Is there a special reason for not setting up viewcvs (v0.8)? I find it quite useful. viewcvs.sourceforge.net The yahoo mail-archive is not nice, I cannot visit it without accepting their cookies. :( Best, Bernhard --=20 Professional Service around Free Software (intevation.net) = =20 The FreeGIS Project (freegis.org) Association for a Free Informational Infrastructure (ffii.org) FSF Europe (fsfeurope.org) --GIP5y49pbaVPin6k Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="createlang.diff" Content-Transfer-Encoding: quoted-printable Recent postgresql docs recommend using createlang for adding a procedural language. See: http://www.postgresql.org/idocs/index.php?xplang.html#XPLANG-INSTALL Changelog: Changed docs at three places to recommend "createlang plpgsql" instead of the manual procedure. <bernhard@intevation.de> Index: README.postgis =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/postgis/postgis/README.postgis,v retrieving revision 1.4 diff -u -r1.4 README.postgis --- README.postgis 2001/09/18 01:34:02 1.4 +++ README.postgis 2001/12/19 18:34:38 @@ -37,17 +37,11 @@ make install =20 PostGIS now requires the PL/pgSQL procedural language in order to operate -correctly. To install PL/pgSQL, locate the plpgsql.so library in your -PostgreSQL installation (usually in the 'lib' directory). Then run the -following SQL commands in your database, replacing the plpgsql.so=20 -location with the correct one for your system: +correctly. To install PL/pgSQL you should use the createlang script coming +with postgresql. (The PostgreSQL 7.1 Programmer's Guide details=20 +if you want to this manually for some reason.) =20 - CREATE FUNCTION plpgsql_call_handler()=20 - RETURNS OPAQUE AS '/usr/local/pgsql/lib/plpgsql.so'=20 - LANGUAGE 'C'; - CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' - HANDLER plpgsql_call_handler - LANCOMPILER 'PL/pgSQL'; + createlang plpgsql yourdatabase =20 Finally, load the function and object definitions into your database=20 with psql (you must run this as a database user with system privledges): Index: postgis.sql.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/postgis/postgis/postgis.sql.in,v retrieving revision 1.20 diff -u -r1.20 postgis.sql.in --- postgis.sql.in 2001/12/12 22:21:59 1.20 +++ postgis.sql.in 2001/12/19 18:34:39 @@ -1,14 +1,8 @@ BEGIN TRANSACTION;=0D =0D =0D ---- you might have to define the plpgsql language something like;=0D -=0D --- CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS=0D --- '/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C';=0D ---=0D --- CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'=0D --- HANDLER plpgsql_call_handler=0D --- LANCOMPILER 'PL/pgSQL';=0D +--- you might have to define the plpgsql language usually done with the;= =0D +--- changelang script.=0D =0D -- here's some hockey code to test to see if plpgsql is installed=0D -- if it is, you get a message "plpgsql is installed" =0D Index: doc/postgis.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/postgis/postgis/doc/postgis.xml,v retrieving revision 1.13 diff -u -r1.13 postgis.xml --- doc/postgis.xml 2001/11/19 17:25:57 1.13 +++ doc/postgis.xml 2001/12/19 18:34:42 @@ -109,11 +109,17 @@ "postgis" directory, and run the compile and install commands. </para>= =0D <programlisting># cd ./postgis-0.6 =0D # make =0D -# make install</programlisting></listitem><listitem><para>As of version 0.= 6, PostGIS requires the PL/pgSQL procedural language extension. Before load= ing the postgis.sql file, you must first enable PL/pgSQL. The code snippet = below gives an example, substitute the correct location of your <filename>p= lpgsql.so</filename> library.</para><programlisting>CREATE FUNCTION plpgsql= _call_handler () RETURNS OPAQUE AS=0D - '/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C';=0D -CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'=0D - HANDLER plpgsql_call_handler=0D - LANCOMPILER 'PL/pgSQL';</programlisting></listitem> =0D +# make install</programlisting></listitem>=0D + <listitem><para>=0D +As of version 0.6, PostGIS requires the PL/pgSQL procedural language exten= sion.=0D +Before loading the postgis.sql file, you must first enable PL/pgSQL. =0D +You should use the <filename>createlang</filename> command.=0D +The PostgreSQL 7.1 Programmer's Guide has the details if you want to this= =0D +manually for some reason.=0D +<programlisting>=0D +# createlang plpgsql [yourdatabase]=0D +</programlisting>=0D + </listitem> =0D <listitem> =0D <para>Finally, you=0D must load the PostGIS object and function definitions into your databa= se. </para> =0D --GIP5y49pbaVPin6k-- --hSZb4FHl1C2xfsUy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Weitere Infos: siehe http://www.gnupg.org iEYEARECAAYFAjwg4LYACgkQh9ag3dpKERZXQwCglwuRAD2QR1Kz2k/V6wKxZB08 fgcAn26IyTsCdZGsBEHfTPkF1RDKoRyq =5X0z -----END PGP SIGNATURE----- --hSZb4FHl1C2xfsUy-- ]