Обсуждение: plpgsql error
I get this error when I try to create a function using plpgsql: ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'. Recognized languages are sql, C, internal and the created procedural languages. Do I need to specify another flag when I compile Postgresql? Adam ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Si hoc legere scis nimium eruditionis habes.
Edit: /usr/src/pgsql/postgresql-6.4.2/src/pl/plpgsql/src/mklang.sql Change: as '${exec_prefix}/lib/plpgsql.so' to: as '/usr/local/pgsql/lib/plpgsql.so' Then: psql your_db < mklang.sql This should really be part of the documentation as I wasted two days on this same problem a few weeks back. Have fun Andy On Mon, 10 May 1999, Adam H. Pendleton wrote: > I get this error when I try to create a function using plpgsql: > > ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'. > Recognized languages are sql, C, internal and the created procedural > languages. > > Do I need to specify another flag when I compile Postgresql? > > Adam > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Si hoc legere scis nimium eruditionis habes. > > >
> > Edit: /usr/src/pgsql/postgresql-6.4.2/src/pl/plpgsql/src/mklang.sql > > Change: as '${exec_prefix}/lib/plpgsql.so' > to: as '/usr/local/pgsql/lib/plpgsql.so' > > Then: psql your_db < mklang.sql > > This should really be part of the documentation as I wasted two days on > this same problem a few weeks back. And this became IMHO an FAQ. Should we avoid it by installing PL/pgSQL and PL/Tcl (if built) by default in the template1 database during intidb? Installing it in template1 would have the effect that it will be available after every createdb. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #======================================== jwieck@debis.com (Jan Wieck) #
jwieck@debis.com (Jan Wieck) writes: >> Change: as '${exec_prefix}/lib/plpgsql.so' >> to: as '/usr/local/pgsql/lib/plpgsql.so' >> >> This should really be part of the documentation as I wasted two days on >> this same problem a few weeks back. > And this became IMHO an FAQ. Should we avoid it by installing > PL/pgSQL and PL/Tcl (if built) by default in the template1 > database during intidb? Actually, I thought the same until last night, when I realized that mklang.sql is in fact being made wrong --- the ${exec_prefix} should be expanded when the file is created, but it isn't. (There's another bug in it too: .so is hardwired, when it should be DLSUFFIX.) So now I think what's really going on is that people *are* faithfully following the install directions, but it's not working because of this screwup. Oops. Fixing it is not quite as trivial as I first thought --- see related messages in hackers list. regards, tom lane
> > > > Edit: /usr/src/pgsql/postgresql-6.4.2/src/pl/plpgsql/src/mklang.sql > > > > Change: as '${exec_prefix}/lib/plpgsql.so' > > to: as '/usr/local/pgsql/lib/plpgsql.so' > > > > Then: psql your_db < mklang.sql > > > > This should really be part of the documentation as I wasted two days on > > this same problem a few weeks back. > > And this became IMHO an FAQ. Should we avoid it by installing > PL/pgSQL and PL/Tcl (if built) by default in the template1 > database during intidb? Installing it in template1 would > have the effect that it will be available after every > createdb. Sure, why not? -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026