Re: [GENERAL] How do write schema independent install files for functions.

2012-07-16 Thread Philip Couling
On 16/07/2012 20:44, Tom Lane wrote: > Philip Couling writes: >> I have a number of functions which I wish to wrap up in a SQL script >> (well technically DDL script). The functions reference one another and >> for safety it is necessary for them to ether set the searc

[GENERAL] How do write schema independent install files for functions.

2012-07-16 Thread Philip Couling
Hi I have a number of functions which I wish to wrap up in a SQL script (well technically DDL script). The functions reference one another and for safety it is necessary for them to ether set the search_path or directly reference the schema for one another. I was wondering if there is good / rec

Re: [GENERAL] Feature discussion: Should syntax errors abort a transaction?

2012-06-20 Thread Philip Couling
On 20/06/2012 08:24, Chris Travers wrote: > It seems to me there is one very simple reason not to change current > behavior which those in favor are glossing over. > > Most interactions with a database are not occurring over an interface > like psql with one person typing on one side and the db ex

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-02 Thread Philip Couling
On 02/03/12 20:58, david.sahag...@emc.com wrote: Can anybody please point me to where this "difference of behavior" is explained/documented ? Thanks, -dvs- -- version = 9.1.3 do $$ declare v_str char(10); begin v_str := 'abc' ; raise info '%', concat(v_str, v_str) ; raise info '%',

Re: [GENERAL] Easy form of "insert if it isn't already there"?

2012-02-15 Thread Philip Couling
This must be a function or trigger to break one statement into two. You could of course simply use two separate statements in PHP as long as they are in the same transaction. If you're going to perform this action in two steps then putting both in a function or trigger is often preferable. Looki

Re: [GENERAL] last entry per person

2012-02-03 Thread Philip Couling
On 03/02/2012 08:30, Chris Travers wrote: On Fri, Feb 3, 2012 at 12:26 AM, garry > wrote: I have a table which holds a user name and their results in exams. There can be multiple entries per user. I am trying to return the last entry for each user. I