[GENERAL] optimum settings for dedicated box

2005-08-30 Thread Matt A.
Wondering what the optimum settings are for an dedicated postgresql database box? The box is an 2.8ghz processor, 1gig ram (soon will be 4) and raid 1 (mirroring) across two 10k rpm SCSI disks. I only have a single database on it running linux of course. Thanks. ___

Re: [GENERAL] [SQL] question

2005-08-29 Thread Matt A.
: Open Your i™ > > http://www.sitening.com/ > 110 30th Avenue North, Suite 6 > Nashville, TN 37203-6320 > 615-469-5150 > 615-469-5151 (fax) > > On Aug 24, 2005, at 12:05 AM, Matt A. wrote: > > > I have a rating section on a website. It has radio > > but

Re: [GENERAL] Altering functions cast

2005-08-26 Thread Matt A.
> On Fri, Aug 26, 2005 at 12:22:27PM -0700, Matt A. > wrote: > > How do I get this to work? > > > > create function nullif_bool(boolean) returns > > bool as ' select nullif(''$1'','''')::bool;' > language > > s

[GENERAL] Altering functions cast

2005-08-26 Thread Matt A.
We use NULLIF() for adding [1|0|null] according to the evalution of nullif('x','') into boolean columns. Where x is [1|0|null], which if it's an empty string (x='') then we add NULL cause NULLIF says if '' == '' then return NULL into boolean. An example wrapper function for this with an integer

[GENERAL] Altering functions cast

2005-08-26 Thread Matt A.
How do I get this to work? create function nullif_bool(boolean) returns bool as ' select nullif(''$1'',)::bool;' language sql; ??? Thank you. Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/

Re: [GENERAL] Serials jumping

2005-08-26 Thread Matt A.
nextval or currval? Is there a best practice for returning the new identities value? I'd prefer it in one call if possible. Thank you. --- Alban Hertroys <[EMAIL PROTECTED]> wrote: > Matt A. wrote: > > I have a serial column on a test box DB. I'm > > using "

[GENERAL] Serials jumping

2005-08-26 Thread Matt A.
I have a serial column on a test box DB. I'm using "select nextval('some_seq') as id" to insert a id in sequence. It doesn't return the next value but at least 4 or so (random) ahead of the current value. Is this to be expected? Is this the most efficient way to retreive an id value for insert a

Re: [GENERAL] Altering built-in functions cast

2005-08-26 Thread Matt A.
: > Matt A. wrote: > > Anyone know how I could alter the cast of the > nullif() > > function directly to return INT? > > > > We use NULLIF() for adding [1|0|null] according to > the > > evalution of nullif('x','') into integer columns. > >

Re: [GENERAL] help

2005-08-26 Thread Matt A.
rget booleans. Forget text. Just integers. Is this possible? Nothing is impossible. Tell me it can be done! Could I use a C++ function to do what I'm trying to accomplish? Or is there an more elegant solution? (like a built in sql one) Thanks --- Martijn van Oosterhout wrote: > On Thu,

[GENERAL] Altering built-in functions cast

2005-08-25 Thread Matt A.
Anyone know how I could alter the cast of the nullif() function directly to return INT? We use NULLIF() for adding [1|0|null] according to the evalution of nullif('x','') into integer columns. Where x is an integer and sometimes a empty string, which if it's an empty string (x='') then we add NULL

Re: [GENERAL] help

2005-08-25 Thread Matt A.
a | isnull > ---+ >| t > 1 | f > (2 rows) > > Please show us the error you got. > > Have a nice day, > > > On Thu, Aug 25, 2005 at 02:57:29PM -0700, Matt A. > wrote: > > hi. I am speaking of INSERT not SELECT > > > > ---

[GENERAL] help

2005-08-25 Thread Matt A.
We used nullif('$value','') on inserts in mssql. We moved to postgres but the nullif() function doesn't match empty strings to each other to return null. MS SQL2000 nullif('1','') would insert 1 as integer even though wrapped in '' (aka string). Also nullif('','') would evaluate NULL (both equal