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

2009-10-25 Thread Craig Ringer
Scott Marlowe wrote: > On Fri, Oct 23, 2009 at 9:32 PM, semi-ambivalent wrote: >> Thanks everyone for the pointers. I like the idea of getting rid of >> the concatenated field even though it reduced the worst case query >> time to one tenth of what I had been seeing. But for now I'm going to >> ke

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

2009-10-23 Thread Scott Marlowe
On Fri, Oct 23, 2009 at 9:32 PM, semi-ambivalent wrote: > 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'l

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 to see if I'm missing something.

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

2009-10-23 Thread Craig Ringer
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 to see if I'm missing something. As others have noted, a multi-field index or a functional index is probably

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

2009-10-22 Thread Roderick A. Anderson
semi-ambivalent wrote: 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 auto-filled

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

2009-10-22 Thread Richard Broersma
On Wed, Oct 21, 2009 at 8:54 PM, 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 to see if I'm missing something. To create an index on a computed value yo

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 > > auto-filled with the valu

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

2009-10-21 Thread David Fetter
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 > auto-filled with the value A||B||C? Just a pointer of where to begin > looking is fine. Trig

[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