[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proposed conventions for plpgsql coding for 1.3 and beyond



Hi all;

Since 1.3 will be our first release with substantial logic
encapsulated in the database, I wanted to get discussion started on
coding conventions.  Currently we are targetting the code for
PostgreSQL 8.0 through 8.2 but want to ensure it is reasonably
future-safe.  My own thinking is that we can worry about most of the
future-safety issues later since the level of alteration isn't likely
to be that great.

Here are my proposals:

Function names should be in the following format:  object_method (i.e.
employee_save).

Function arguments should be declared in the definition, and should be
prefixed with in_ to ensure uniqueness from the column names.

Functions which save entities should return the primary key of the saved entity.

Any feedback?

Best WIshes,
Chris Travers