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

Re: pg/sql functions field order



Hello Erik and all,

On Sat, Aug 15, 2015 at 04:48:22PM +0200, Erik Huelsmann wrote:

> The functions are there to prevent the same queries coming up over and

On first reading, I took the above to mean "the same [SQL] queries"
being repeated; at my second read, it seemed to refer to FAQs.
Now, I am not sure which, but the two issues intertwine.  

> Now, you could argue that we should use views to prevent the
> duplication. Basically, that's what we do through the PL/pgSQL functions:
> we use them as parameterized views.

I am on board with the function concept, just not up to speed on 
the details.

If functions define the application, then should I be looking at
the main schema to find what the functions do?.  

The ~/doc/database/ contents seem dated.  Should I rely on them?

I find the double underscores hard to parse.


> > The wrong may be that I am used to my sql being set up from DBI.

> I'm sorry, but I don't know what you mean by this remark, 

I meant:  I discount the value of my opinion because I am used to
using a different pattern and style.


> > I see that the field order is the same as a
> > "select *" or the order of definition in the
> > sql create statement.

> Well, if you use the functions like this, then yes, I understand why you

That was just an example.  In a program, "select *" is a trap; 
change a table definition and break your queries; I have not yet 
found how you control that.  

Erik, thanks, your reply has been helpful.

Rob

------------------------------------------------------------------------------
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel