Skip site navigation (1) Skip section navigation (2)

question

From: "Matt A(dot)" <survivedsushi(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: question
Date: 2005-08-24 05:05:01
Message-ID: 20050824050501.43778.qmail@web35204.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-sql
I have a rating section on a website. It has radio
buttons with values 1-5 according to the rating level.
Lastly there is a null option for n/a. We use null for
n/a so it's excluded from the AVG() calculations.

We used nullif('$value','') on inserts in mssql.  We
moved to postgres and love it but the nullif() doesn't
match empty strings to each other to return null other
than a text type, causing an error. This is a major
part of our application.

AKA nullif('1','') would insert 1 as integer even
though wrapped in ''. Also nullif('','') would
evaluate NULL and insert the "not a value"
accordingly.

Is there a workaround for this so it doesn't break our
rating system? We cannot always enter a value for a
integer column. Is there any other way to accomplish
this? Please help.


	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

Responses

pgsql-sql by date

Next:From: Bo LorentsenDate: 2005-08-24 09:22:08
Subject: Number of rows in a cursor ?
Previous:From: neil.saundersDate: 2005-08-23 19:59:29
Subject: Re: Problem calling stored procedure

pgsql-general by date

Next:From: wolverine myDate: 2005-08-24 05:05:08
Subject: Re: ERROR: database is being accessed by other users
Previous:From: Jim C. NasbyDate: 2005-08-24 04:36:31
Subject: Re: ctid access is slow

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group