Re: PL/pgSQL 1.2 - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: PL/pgSQL 1.2
Date
Msg-id CAFj8pRBnDca6fqWaN_=1kQ5qZpwxwitcfrsp1ZNUaOqx_4q7+w@mail.gmail.com
Whole thread Raw
In response to Re: PL/pgSQL 1.2  (Joel Jacobson <joel@trustly.com>)
Responses Re: PL/pgSQL 1.2
List pgsql-hackers
<div dir="ltr"><br /><div class="gmail_extra"><br /><br /><div class="gmail_quote">2014-09-04 9:37 GMT+02:00 Joel
Jacobson<span dir="ltr"><<a href="mailto:joel@trustly.com" target="_blank">joel@trustly.com</a>></span>:<br
/><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On
Wed,Sep 3, 2014 at 11:19 PM, Hannu Krosing <<a href="mailto:hannu@2ndquadrant.com">hannu@2ndquadrant.com</a>>
wrote:<br/> > SELECT[1]   - select exactly one row, anything else raises error<br /> > SELECT[0:1]   - select
zeroor one rows, anything else raises error<br /> > SELECT[1:] - select one or more rows<br /> ><br /> > plain
SELECTis equivalent to SELECT[0:]<br /> ><br /> > same syntax could be used for enforcing sane affected row
counts<br/> > for INSERT and DELETE<br /><br /></div>+1 for a new fresh creative idea! My mind was stuck in a
"lookingfor<br /> keywords" state.<br /><br /> The only suggestion I think is slightly better is the "STRICT
UPDATE",<br/> but only if I'm right assuming the "one row" use-case is much more<br /> common than the "zero or one
rows"and "one or more rows" use-cases.<br /><br /> If all use-cases are equally important to support in a nice way,<br
/>then the suggested syntax is brilliant, as it supports all of them.<br /><br /> Bonus points for the extremely
condensedsyntax.<br /><div class=""><br /> > 2. Substitute for EXECUTE with string manipulation<br /> >
----------------------------------------------------------------<br/> ><br /> > using backticks `` for
value/commandsubstitution in SQL as an alternative<br /> > to EXECUTE string<br /><br /></div>+1 for being backwards
compatible,but I have no strong opinion.<br /><div class=""><br /> > 3. A way to tell pl/pggsql not to cache plans
fronormal queries<br /> > -----------------------------------------------------------------------------------<br
/><br/></div><div class="">> OR we could do it in SQL-ish way using like this:<br /> ><br /> > SELECT<br />
>...<br /> > USING FRESH PLAN;<br /><br /></div>+1 for clean syntax<br /></blockquote></div><br /></div><div
class="gmail_extra">wehave totally different opinion what is good<br /><br /></div><div class="gmail_extra">Regards<br
/><br/>Pavel<br /></div></div> 

pgsql-hackers by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: PL/pgSQL 1.2
Next
From: Joel Jacobson
Date:
Subject: Re: PL/pgSQL 1.2