Questions on stored-procedure best practices - Mailing list pgsql-general

From Eric Brown
Subject Questions on stored-procedure best practices
Date
Msg-id 20FDA8A8-4AFF-11D9-BE63-000A95C7176C@propel.com
Whole thread Raw
Responses Re: Questions on stored-procedure best practices  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general
I'm used to writing C/Java/python type stuff and am a bit new to stored
procedures and looking for a few best practices. I'm using plpgsql (as
opposed to plpython, etc.) because it offers the most flexibility in
terms of data-types, etc.

good editor:
Usually emacs does a good job, but postgres puts a stored procedure
between ' and ' and this turns off any font-lock highlighting for the
entire stored procedure. Can I use something other than quotes or fix
this somehow? Is there a better editor?

preprocessor:
I saw one reference to people running stuff through the C-preprocessor
before importing into their DB. Is this common practice? I don't see a
huge benefit for it yet unless I want to support multiple DBs.

file-names:
I know it doesn't matter, but mostly it seems to make sense to put
stuff in .sql files. I've seen some reference to people putting stuff
in .sp files. What works best for people in terms of organization?

packages:
I saw there was a patch to support oracle-style packages in postgres
back in ~2001, but I saw nothing else. Is this planned? I imagine I
could use 'schemas', but I don't think this lets me share variables and
I think these are more for splitting up table name-spaces than for
associating a group of functions.

other:
Any other suggestions?

Thanks.

Eric Brown
408-571-6341
www.propel.com

pgsql-general by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: migrating from informix
Next
From: Alvaro Herrera
Date:
Subject: Re: vacuum problem?