Re: [SQL] SQL FUNCTION return type on INSERT

2001-11-03 Thread Josh Berkus
Eddy, > What value should I RETURN for a SQL FUNCTION that contains an INSERT > statement? OPAQUE. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management

[SQL] Book reviews are up

2001-11-03 Thread Josh Berkus
Folks, Our first four PostgreSQL-related book reviews are up at Techdocs: http://techdocs.postgresql.org/techdocs/bookreviews.php As I said before, we need more reviews to make this the comprehensive reading list for the PostgreSQL user. Especially we need reviews of books in other languages.

Re: [SQL] Strange Problem As Type Casting

2001-11-03 Thread Josh Berkus
Bhuvanm > test=> UPDATE users set user_id=1 ,login_id='admin' where > user_id='1346'; > ERROR: Unable to identify an operator '=' for types 'text' and > 'int4' > You will have to retype this query using an explicit cast Stop quoting your integers. It should be WHERE user_id = 1346 No

[SQL] SQL FUNCTION return type on INSERT

2001-11-03 Thread Edward Grabczewski
What value should I RETURN for a SQL FUNCTION that contains an INSERT statement? -- Eddy Grabczewski [EMAIL PROTECTED] ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] SQL FUNCTION return type on INSERT

2001-11-03 Thread Edward Grabczewski
I've just looked at the new online 7.2 documentation and found that all functions must end in some kind of select. How about this then? CREATE FUNCTION foo(varchar) RETURN unknown AS ' INSERT INTO footable VALUES ($1); SELECT null; ' LANGUAGE 'sql'; "Edward Grabczewski" <[EMAIL PROTE

Re: [SQL] PL/pgSQL syntax for strings

2001-11-03 Thread Edward Grabczewski
I've sorted this one thanks to John Berkus. Thanks guys. I've included the solution below for your interest. === DROP TABLE rtest; DROP INDEX rtest_xz_index; DROP INDEX rtest_yz_index; DROP INDEX rtest_xy_index; CREATE TABLE rtest (

Re: [SQL] Strange Problem As Type Casting

2001-11-03 Thread Tom Lane
Bhuvan A <[EMAIL PROTECTED]> writes: > test=> UPDATE users set user_id=1 ,login_id='admin' where user_id='1346'; > ERROR: Unable to identify an operator '=' for types 'text' and 'int4' > You will have to retype this query using an explicit cast Got any triggers, rules, or foreign keys fo