Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id DDF052E004B for ; Wed, 21 Nov 2007 11:29:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 34110-07-3 for ; Wed, 21 Nov 2007 11:29:18 -0400 (AST) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by postgresql.org (Postfix) with ESMTP id 0196D2E0033 for ; Wed, 21 Nov 2007 11:29:16 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c36so438320ana for ; Wed, 21 Nov 2007 07:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=8E9ruHeGwIjDobQA/E+gbVWcUS6K8pjaFf4hxjewfSE=; b=otbamb5a22lYhBflLSBkFcMLSTuVwYHTw0hJr4pqylCY//ITsrNi+UMvGfArdFPheHDEKjErGcCLxq2OoMKOk0cOtqIXQVWWa+swpDIXDRsHz2bB1wS/QpaRb1LWZ/ROXGOW1iX7EJJ1WUUINElSCRONXW/Y6gMyQ9pBSeCbp1o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lkE8KhABbIwyN07kfrE0Uoxem8D6LmALTuWjy38+GN6AOq868ff6V9fXnHh/UxIPLoPUBLXVZk38wncrbBzDQtDNEalmWIN/qZbc54bSFcARC66CplYBemLx3ja9hRwqY/sBR+dhDHdA7TE4qsv7oVVvhktq7atowyOHdYtdxUo= Received: by 10.100.216.3 with SMTP id o3mr10022984ang.1195658955739; Wed, 21 Nov 2007 07:29:15 -0800 (PST) Received: by 10.90.120.17 with HTTP; Wed, 21 Nov 2007 07:29:15 -0800 (PST) Message-ID: Date: Wed, 21 Nov 2007 10:29:15 -0500 From: "=?UTF-8?Q?Rodrigo_De_Le=C3=B3n?=" To: "Martin Marques" Subject: Re: PL argument max size, and doubt Cc: "PostgreSQL SQL List" In-Reply-To: <4744313C.40107@marquesminen.com.ar> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4744313C.40107@marquesminen.com.ar> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/102 X-Sequence-Number: 29630 On Nov 21, 2007 8:23 AM, Martin Marques wrote: > (BTW, which it that limit if it exists?). "In any case, the longest possible character string that can be stored is about 1 GB." See: http://www.postgresql.org/docs/8.2/static/datatype-character.html > So I made the function to test: > > CREATE OR REPLACE FUNCTION datoGrande(TEXT) RETURNS BOOLEAN AS $body$ > BEGIN > EXECUTE $ins1$ > INSERT INTO funcdatogrande VALUES (default,$ins1$ || > quote_literal($1) || $ins2$)$ins2$; > IF FOUND THEN > RETURN TRUE; > ELSE > RETURN FALSE; > END IF; > END; > $body$ LANGUAGE 'plpgsql'; > > > What bothers me is that the INSERT passes ok (the data is inserted) but > the function is returning false on any all to it. I hope not to have a > conceptual problem. I don't think EXECUTEing sets FOUND to true. Try: CREATE OR REPLACE FUNCTION DATOGRANDE(TEXT) RETURNS BOOLEAN AS $$ BEGIN INSERT INTO FUNCDATOGRANDE VALUES (DEFAULT,$1); IF FOUND THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END; $$ LANGUAGE 'PLPGSQL';