Thread: hstore isexists

hstore isexists

From
Andrew Dunstan
Date:
Before we spring hstore on an unsuspecting world as a contrib module, in 
the interests of good English, is it too late to change "isexists" to 
simply "exists"?

cheers

andrew


Re: hstore isexists

From
Bruce Momjian
Date:
Andrew Dunstan wrote:
> 
> Before we spring hstore on an unsuspecting world as a contrib module, in 
> the interests of good English, is it too late to change "isexists" to 
> simply "exists"?

Sure, we can do it, as long as we aren't worried about adding
incompatibilities for existing hstore users.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: hstore isexists

From
Teodor Sigaev
Date:
It's possible to create function 'exists' and mention only it in docs.

Bruce Momjian wrote:
> Andrew Dunstan wrote:
>> Before we spring hstore on an unsuspecting world as a contrib module, in 
>> the interests of good English, is it too late to change "isexists" to 
>> simply "exists"?
> 
> Sure, we can do it, as long as we aren't worried about adding
> incompatibilities for existing hstore users.
> 

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


Re: hstore isexists

From
Andrew Dunstan
Date:
Teodor Sigaev wrote:
> It's possible to create function 'exists' and mention only it in docs.

Good point. Will you do that, or do you want me to?


>
> Bruce Momjian wrote:
>> Andrew Dunstan wrote:
>>> Before we spring hstore on an unsuspecting world as a contrib 
>>> module, in the interests of good English, is it too late to change 
>>> "isexists" to simply "exists"?
>>
>> Sure, we can do it, as long as we aren't worried about adding
>> incompatibilities for existing hstore users.
>>
>


Re: hstore isexists

From
Teodor Sigaev
Date:

Andrew Dunstan wrote:
> Teodor Sigaev wrote:
>> It's possible to create function 'exists' and mention only it in docs.
> 
> Good point. Will you do that, or do you want me to?

May I ask you? I'm afraid that there is more incorrectness.


-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


Re: hstore isexists

From
Andrew Dunstan
Date:
Teodor Sigaev wrote:
>
>
> Andrew Dunstan wrote:
>> Teodor Sigaev wrote:
>>> It's possible to create function 'exists' and mention only it in docs.
>>
>> Good point. Will you do that, or do you want me to?
>
> May I ask you? I'm afraid that there is more incorrectness.
>
>

Well, "isdefined" isn't incorrect, but I think there's a good case to 
change it to just "defined", since exists and defined are the names of 
the corresponding perl tests on associative arrays. All the rest look ok 
to me.

cheers

andrew


Re: hstore isexists

From
Teodor Sigaev
Date:
'exists' isn't a good name for function :(. From gram.y:
col_name_keyword:...

function_name:            IDENT                                   { $$ = $1; }            | unreserved_keyword
         { $$ = pstrdup($1); }            | func_name_keyword                     { $$ = pstrdup($1); }        ;
 

So call of function named 'exists' should be in quotas:
select "exists"('a=>1','a');

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


Re: hstore isexists

From
Tom Lane
Date:
Teodor Sigaev <teodor@sigaev.ru> writes:
> 'exists' isn't a good name for function :(.

Yeah, that isn't going to work.  Perhaps "ifexists"?  Or just leave well
enough alone.
        regards, tom lane


Re: hstore isexists

From
Andrew Dunstan
Date:
Tom Lane wrote:
> Teodor Sigaev <teodor@sigaev.ru> writes:
>   
>> 'exists' isn't a good name for function :(.
>>     
>
> Yeah, that isn't going to work.  Perhaps "ifexists"?  Or just leave well
> enough alone.
>
>
>   

Darn. Can't have been thinking clearly this morning.

How about "exist" (no s)?

cheers

andrew





Re: hstore isexists

From
Tom Lane
Date:
Andrew Dunstan <andrew@dunslane.net> writes:
> How about "exist" (no s)?

Seems a bit ugly, but better than isexists or ifexists ...
        regards, tom lane


Re: hstore isexists

From
"korryd@enterprisedb.com"
Date:
<blockquote type="CITE"><pre>
<font color="#000000">>> 'exists' isn't a good name for function :(.</font>
<font color="#000000">>>     </font>
<font color="#000000">></font>
<font color="#000000">> Yeah, that isn't going to work.  Perhaps "ifexists"?  Or just leave well</font>
<font color="#000000">> enough alone.</font>
<font color="#000000">></font>
<font color="#000000">></font>
<font color="#000000">>   </font>

<font color="#000000">Darn. Can't have been thinking clearly this morning.</font>

<font color="#000000">How about "exist" (no s)?</font>
</pre></blockquote><pre>

</pre> Maybe 'found', 'present', or 'contains'?  (no, I haven't checked for a grammar conflict)<br /><br />         --
Korry<br/><br /><br /><br /> 

Re: hstore isexists

From
"Jim C. Nasby"
Date:
On Wed, Oct 11, 2006 at 10:04:10AM -0400, Andrew Dunstan wrote:
> Teodor Sigaev wrote:
> >It's possible to create function 'exists' and mention only it in docs.
> 
> Good point. Will you do that, or do you want me to?
ISTM it would be better to mention the deprecated version and
explicitly state that it's deprecated.

> >
> >Bruce Momjian wrote:
> >>Andrew Dunstan wrote:
> >>>Before we spring hstore on an unsuspecting world as a contrib 
> >>>module, in the interests of good English, is it too late to change 
> >>>"isexists" to simply "exists"?
> >>
> >>Sure, we can do it, as long as we aren't worried about adding
> >>incompatibilities for existing hstore users.
> >>
> >
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
> 

-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: hstore isexists

From
Andrew Dunstan
Date:
Jim C. Nasby wrote:
> On Wed, Oct 11, 2006 at 10:04:10AM -0400, Andrew Dunstan wrote:
>   
>> Teodor Sigaev wrote:
>>     
>>> It's possible to create function 'exists' and mention only it in docs.
>>>       
>> Good point. Will you do that, or do you want me to?
>>     
>  
> ISTM it would be better to mention the deprecated version and
> explicitly state that it's deprecated.
>
>   

If we had had this in contrib previously with the deprecated call I 
would agree. But it seems like bad practice and unnecessary clutter to 
start off by deprecating something.

cheers

andrew


Re: hstore isexists

From
"Jim C. Nasby"
Date:
On Wed, Oct 11, 2006 at 04:17:19PM -0400, Andrew Dunstan wrote:
> Jim C. Nasby wrote:
> >On Wed, Oct 11, 2006 at 10:04:10AM -0400, Andrew Dunstan wrote:
> >  
> >>Teodor Sigaev wrote:
> >>    
> >>>It's possible to create function 'exists' and mention only it in docs.
> >>>      
> >>Good point. Will you do that, or do you want me to?
> >>    
> > 
> >ISTM it would be better to mention the deprecated version and
> >explicitly state that it's deprecated.
> >
> >  
> 
> If we had had this in contrib previously with the deprecated call I 
> would agree. But it seems like bad practice and unnecessary clutter to 
> start off by deprecating something.

Sorry, I don't know the history of hstore... but if it's brand new, why
are we worried about backwards compatibility?
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: hstore isexists

From
Tom Lane
Date:
"Jim C. Nasby" <jim@nasby.net> writes:
> Sorry, I don't know the history of hstore... but if it's brand new, why
> are we worried about backwards compatibility?

Because it's been available for awhile outside of contrib (namely,
on Oleg and Teodor's own site).  So there are people using it.
        regards, tom lane


Re: hstore isexists

From
Andrew Dunstan
Date:
Jim C. Nasby wrote:
> Sorry, I don't know the history of hstore... but if it's brand new, why
> are we worried about backwards compatibility?
>   

It has existed for a while, but has not previously been in contrib.

cheers

andrew



Re: hstore isexists

From
"Jim C. Nasby"
Date:
On Wed, Oct 11, 2006 at 05:00:50PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jim@nasby.net> writes:
> > Sorry, I don't know the history of hstore... but if it's brand new, why
> > are we worried about backwards compatibility?
> 
> Because it's been available for awhile outside of contrib (namely,
> on Oleg and Teodor's own site).  So there are people using it.

So wouldn't it make sense to document that the old functions are
depricated so those existing users will stop using them? Maybe the base
documentation isn't the best place for that... perhaps an UPGRADING
section.
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: hstore isexists

From
Bruce Momjian
Date:
Jim C. Nasby wrote:
> On Wed, Oct 11, 2006 at 05:00:50PM -0400, Tom Lane wrote:
> > "Jim C. Nasby" <jim@nasby.net> writes:
> > > Sorry, I don't know the history of hstore... but if it's brand new, why
> > > are we worried about backwards compatibility?
> > 
> > Because it's been available for awhile outside of contrib (namely,
> > on Oleg and Teodor's own site).  So there are people using it.
> 
> So wouldn't it make sense to document that the old functions are
> depricated so those existing users will stop using them? Maybe the base
> documentation isn't the best place for that... perhaps an UPGRADING
> section.

The source code should mention it --- that's all.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +