Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9DF992E0284 for ; Tue, 4 Dec 2007 09:41:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 95646-08 for ; Tue, 4 Dec 2007 09:41:47 -0400 (AST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by postgresql.org (Postfix) with ESMTP id E32E72E01B3 for ; Tue, 4 Dec 2007 09:41:54 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so2467214nfh for ; Tue, 04 Dec 2007 05:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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=oGByHMR1hvxJKEX/Og1M09IOXMDTTocR3Zv6cVUfqEs=; b=MbchAlBsn/9Y4OaZf0OBu9OuMaSjknSF63kzww4jZFiLboC8HcD5S7WIVwr8Kd70p037mY9aQ5TAPxrwCgKwPVjWqJJn2DMcwkZze1OqzPt9iG+aLlI1CjkAQABaWFHiA2DG2O9DTozZaGLKBSPBil7F+SURThCilLOK219MHi4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KcCh4vM9n0qacBBZSAWiW+Cl59ca96lgJHRF+3iUNMLC69ZOAWl8WxhBeT24/+iQNu4cy3e88cVebMmdO2dfalAf/PjbC2Wb6CymHJgw+d//RQobbucAHiq1NjgWJg+QiB6lnTzyXBl+DloKc3qgSrsURVwj8xNQpBQpRoO06BY= Received: by 10.78.136.9 with SMTP id j9mr7053152hud.1196775711627; Tue, 04 Dec 2007 05:41:51 -0800 (PST) Received: by 10.78.35.7 with HTTP; Tue, 4 Dec 2007 05:41:51 -0800 (PST) Message-ID: <162867790712040541j296bbc8dt9383293690872c64@mail.gmail.com> Date: Tue, 4 Dec 2007 14:41:51 +0100 From: "Pavel Stehule" To: "Achilleas Mantzios" Subject: Re: Calling functions from within pl/pgsql Cc: pgsql-sql@postgresql.org In-Reply-To: <200712041523.05011.achill@matrix.gatewaynet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200712041416.50322.achill@matrix.gatewaynet.com> <162867790712040459s6ee86399h5dac46cc20d95e9f@mail.gmail.com> <200712041523.05011.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/7 X-Sequence-Number: 29699 Hello a := exprx is internally translated : get result of SELECT exprx and store it to a so you can write select sin(10); then you can a := sin(10) but you can too use subselect like: SELECT (SELECT v FROM foo LIMIT 1) ~ you can write a := (SELECT v FROM foo LIMIT 1); that is equal to SELECT INTO a v FROM foo Pavel > > http://www.postgresql.org/docs/8.2/interactive/plpgsql-statements.html#PLPG > >SQL-STATEMENTS-ASSIGNMENT > > Sure, i missed the > "As explained above, the expression in such a statement is evaluated by means > of an SQL SELECT command sent to the main database engine. The expression > must yield a single value." > part. > Thanx. > > > > > Regards > > Pavel Stehule > > > > > -- > > > Achilleas Mantzios > > > > > > ---------------------------(end of broadcast)--------------------------- > > > TIP 6: explain analyze is your friend > > > > -- > Achilleas Mantzios >