[GENERAL] auto-filling a field on insert

2009-10-21 Thread semi-ambivalent
If I have a table with fields A, B, C and D how could I do something such that if I insert values in fields A, B and C field D would be auto-filled with the value A||B||C? Just a pointer of where to begin looking is fine. Triggers? Copy ... From? Table or field definitions? thx -- Sent via pgsql

Re: [GENERAL] auto-filling a field on insert

2009-10-22 Thread semi-ambivalent
On Oct 21, 8:54 pm, da...@fetter.org (David Fetter) wrote: > On Wed, Oct 21, 2009 at 07:17:44PM -0700, semi-ambivalent wrote: > > If I have a table with fields A, B, C and D how could I do something > > such that if I insert values in fields A, B and C field D would be > >

Re: [GENERAL] auto-filling a field on insert

2009-10-23 Thread semi-ambivalent
On Oct 23, 5:10 am, cr...@postnewspapers.com.au (Craig Ringer) wrote: > semi-ambivalent wrote: > > At first blush that looks good but I need an index on that concatted > > value and I don't seem to be able to index a field in a view. I'll > > check the docs on views

[GENERAL] How to find avg() of sum()?

2010-04-16 Thread semi-ambivalent
I have some data fields that I have summed, grouped by a date field. The sums are different. How can I then calculate the average value for those sums? Everything I've tried errors out with something along the lines of using agregates where I can't, or for using multiple values where that is not al

[GENERAL] Changes in 8.2's PHP behaviour?

2006-12-18 Thread semi-ambivalent
All, I have a simple web page that inserts data into a table in 8.1.5 using PHP4. It's pretty amateurish but gets the job done. A few days ago I upgraded to 8.2 (this is on a FreeBSD system, and I used the port) but when I tried to use the web page this morning I got errors about: PHP Fatal error

Re: [GENERAL] Changes in 8.2's PHP behaviour?

2006-12-19 Thread semi-ambivalent
Erik Jones wrote: > You probably need to re-compile PHP so that it can correctly link to the > new postgres binaries. > > semi-ambivalent wrote: > > All, > > > > I have a simple web page that inserts data into a table in 8.1.5 using > > PHP4. It's prett

[GENERAL] Proper escaping for char(3) string, or PHP at fault, or me at fault?

2007-02-13 Thread semi-ambivalent
All, I have a char(3) column that has occasional values of this: (V) In a PHP-called nested query I've a line something like: select * from tableA where = any (select date from tableA where void ! = '(V)') group by date order by record This is throwing a query error in the log that blames the p