Re: [SQL] not null - trivial, unexpected behavior

2001-06-16 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > John Scott writes: >> but, as i understand the sql92 standard, both att = null and att != null >> are NOT sql92. > They are. We just don't implement att = null right because of reasons > that can be found in the archives. In a very narrow sense, th

[SQL] Re: [HACKERS] Postgres

2001-06-16 Thread Tom Lane
Guru Prasad <[EMAIL PROTECTED]> writes: > using postgres 7.1 version. Now the database got corrupted. I had no clue > how it got corrupted. Basically, i did found that the data of various > users existing (in /usr/local/pgsql/data directory). But there were no > data existing in the following syst

Re: [SQL] casts and conversions

2001-06-16 Thread Tom Lane
Craig Longman <[EMAIL PROTECTED]> writes: > select (unitcost*probability) from oppproducttype > ERROR: Unable to identify an operator '*' for types 'numeric' and > 'float8' > You will have to retype this query using an explicit cast > is this kind of thing a regular thing for postgresql?

Re: [SQL] calling user defined function with parameters..

2001-06-16 Thread Stephan Szabo
What version are you using and what error are you getting? Your example works for me on 7.2devel once i made a dpts table with an id_dpt column. The function code is not checked for plpgsql until its first use, so if there was a syntax error, it wouldn't be seen until you tried to use it. On S

Re: [SQL] not null - trivial, unexpected behavior

2001-06-16 Thread Tom Lane
John Scott <[EMAIL PROTECTED]> writes: > select count(*) from A where b = null; /* Returns 1, ok */ > select count(*) from A where b != null; /* Returns 0 ... not ok! */ Uh ... there have been several threads about this just in the past couple days. See for example http://www.ca.postgre

[SQL] calling user defined function with parameters..

2001-06-16 Thread Postgresql
Hi, I've created a function like this : CREATE FUNCTION tester(INT4) RETURNS BOOL AS ' DECLARE r RECORD; p ALIAS FOR $1; BEGIN SELECT INTO r id_dpt FROM dpts WHERE id_dpt=p; IF NOT FOUND THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END; ' LANGUAGE 'plpgsql'; All is ok at cr