<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL vs PL/pgSQL &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/sql-vs-plpgsql/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 01 Sep 2016 17:16:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>PostgreSQL: What are the Differences between SQL and PL/pgSQL language in Function</title>
		<link>https://www.dbrnd.com/2016/09/postgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 01 Sep 2016 17:16:01 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[Procedure block]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL vs PL/pgSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3572</guid>

					<description><![CDATA[Most of the new PostgreSQL comers have doubt for SQL and PL/pgSQL language of PostgreSQL. In the PostgreSQL, We can create function mainly using three languages like: SQL, PL/pgSQL, C programming. PostgreSQL also supported lot many languages like: Perl, Python, Ruby, Java and others. Most of the PostgreSQL Database Developers are using SQL and PL/pgSQL [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fpostgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function%2F&amp;linkname=PostgreSQL%3A%20What%20are%20the%20Differences%20between%20SQL%20and%20PL%2FpgSQL%20language%20in%20Function" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fpostgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function%2F&amp;linkname=PostgreSQL%3A%20What%20are%20the%20Differences%20between%20SQL%20and%20PL%2FpgSQL%20language%20in%20Function" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fpostgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function%2F&amp;linkname=PostgreSQL%3A%20What%20are%20the%20Differences%20between%20SQL%20and%20PL%2FpgSQL%20language%20in%20Function" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fpostgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function%2F&amp;linkname=PostgreSQL%3A%20What%20are%20the%20Differences%20between%20SQL%20and%20PL%2FpgSQL%20language%20in%20Function" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fpostgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function%2F&amp;linkname=PostgreSQL%3A%20What%20are%20the%20Differences%20between%20SQL%20and%20PL%2FpgSQL%20language%20in%20Function" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fpostgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function%2F&amp;linkname=PostgreSQL%3A%20What%20are%20the%20Differences%20between%20SQL%20and%20PL%2FpgSQL%20language%20in%20Function" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fpostgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function%2F&#038;title=PostgreSQL%3A%20What%20are%20the%20Differences%20between%20SQL%20and%20PL%2FpgSQL%20language%20in%20Function" data-a2a-url="https://www.dbrnd.com/2016/09/postgresql-what-are-the-differences-between-sql-and-plpgsql-language-in-function/" data-a2a-title="PostgreSQL: What are the Differences between SQL and PL/pgSQL language in Function"></a></p><p>Most of the new PostgreSQL comers have doubt for SQL and PL/pgSQL language of PostgreSQL.</p>
<blockquote><p>In the PostgreSQL, We can create function mainly using three languages like: SQL, PL/pgSQL, C programming.</p>
<p>PostgreSQL also supported lot many languages like: Perl, Python, Ruby, Java and others.</p></blockquote>
<p>Most of the PostgreSQL Database Developers are using SQL and PL/pgSQL language.</p>
<p><strong>What are the main differences between SQL and PL/pgSQL?</strong></p>
<p><strong>SQL Language:</strong></p>
<ul>
<li>This is a pure SQL only.</li>
<li>SQL language executes an arbitrary list of SQL statements and returning the result of the last query in the list.</li>
<li>SQL provides a very simple scalar query and It is not supported any query cache or query plan mechanism.</li>
<li>It is portable and easy to learn.</li>
<li>We cannot use any transaction command like: COMMIT, ROLLBACK and SAVEPOINT</li>
<li>When we do not require to return any value, We can define SQL functions as void.</li>
<li>For example,<br />
<pre class="crayon-plain-tag">CREATE FUNCTION fn_UpdateStudents() RETURNS void AS
'UPDATE tbl_Students SET StudName=''Anvesh'' WHERE 1=2'
LANGUAGE SQL;</pre>
</li>
<li>We cannot use any VACUUM related commands in SQL Function.</li>
<li>We cannot use any prepared statements in SQL Function.</li>
<li>We can use SQL language for simple scalar queries because It does not support all other Procedural language feature like PL/pgSQL.(Features like: variables, loops, cursors, transaction command, query plan, query cache)</li>
<li>One of the disadvantage is, every SQL statement must be executed individually by the database server and all other queries have to wait for it to be processed.</li>
</ul>
<p><strong>PL/pgSQL Language:</strong></p>
<ul>
<li>PL/pgSQL is a procedural language, we can execute a block of statement inside the database server.</li>
<li>We can eliminate extra round trips between server and client.</li>
<li>We can use feature like: variable, dynamic query, cursor, trigger, transaction command and others.</li>
<li>Like SQL Language, we can also set a return value in PL/pgSQL.</li>
<li>We have N number of ways to write PL/pgSQL block for increasing the query performance.</li>
<li>All query plans can be cached and we can use as a prepared statement.</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
