0

How do I modify source code for a postgres extension? I'm trying to do it with pgRouting: so the code is in ../postgresql/9.1/contrib, and when I save the changes, nothing's applied. I tried to restart postgresql service, to drop and re-create extension for the database - still no luck.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
rocknrollnerd
  • 2,564
  • 1
  • 16
  • 20

1 Answers1

2

After you've edited the source you need to rebuild it (typically "make") and then reinstall it (typically "make install"). For most extensions you don't need to restart postgres, but you do have to disconnect your session and start a new one.

If you have made any changes to SQL or PL/SQL or similar objects in the extension, you should either give it a new version number and upgrade it, or drop and recreate it.

Magnus Hagander
  • 23,890
  • 5
  • 56
  • 43
  • Thanks, Magnus, got it. I just thought since it's something that's not compiled binary, I can edit it on the fly (not really familiar with PL/SQL, unfortunately). – rocknrollnerd Aug 19 '13 at 18:38
  • You'll quite likely need to uninstall + reinstall the extension too, if there are any sql script changes that need to be picked up. – Richard Huxton Aug 19 '13 at 21:50
  • If it's completely uncompiled, then you would normally not need the *make* step, that's correct. However, you still need *make install*, so that it copies the files from the source directory to the installation directory. And then as Richard says, also either upgrade or uninstall+reinstall. – Magnus Hagander Aug 20 '13 at 05:28