hstore isexists

Started by Andrew Dunstanover 19 years ago18 messages
#1Andrew Dunstan
andrew@dunslane.net

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

#2Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#1)
Re: hstore isexists

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. +

#3Teodor Sigaev
teodor@sigaev.ru
In reply to: Bruce Momjian (#2)
Re: hstore isexists

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/

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Teodor Sigaev (#3)
Re: hstore isexists

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?

Show quoted text

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.

#5Teodor Sigaev
teodor@sigaev.ru
In reply to: Andrew Dunstan (#4)
Re: hstore isexists

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/

#6Andrew Dunstan
andrew@dunslane.net
In reply to: Teodor Sigaev (#5)
Re: hstore isexists

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

#7Teodor Sigaev
teodor@sigaev.ru
In reply to: Andrew Dunstan (#6)
Re: hstore isexists

'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/

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Teodor Sigaev (#7)
Re: hstore isexists

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

#9Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#8)
Re: hstore isexists

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

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#9)
Re: hstore isexists

Andrew Dunstan <andrew@dunslane.net> writes:

How about "exist" (no s)?

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

regards, tom lane

#11korryd@enterprisedb.com
korryd@enterprisedb.com
In reply to: Andrew Dunstan (#9)
Re: hstore isexists

'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)?

Maybe 'found', 'present', or 'contains'? (no, I haven't checked for a
grammar conflict)

-- Korry

#12Jim C. Nasby
jim@nasby.net
In reply to: Andrew Dunstan (#4)
Re: hstore isexists

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)

#13Andrew Dunstan
andrew@dunslane.net
In reply to: Jim C. Nasby (#12)
Re: hstore isexists

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

#14Jim C. Nasby
jim@nasby.net
In reply to: Andrew Dunstan (#13)
Re: hstore isexists

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)

#15Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jim C. Nasby (#14)
Re: hstore isexists

"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

#16Andrew Dunstan
andrew@dunslane.net
In reply to: Jim C. Nasby (#14)
Re: hstore isexists

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

#17Jim C. Nasby
jim@nasby.net
In reply to: Tom Lane (#15)
Re: hstore isexists

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)

#18Bruce Momjian
bruce@momjian.us
In reply to: Jim C. Nasby (#17)
Re: hstore isexists

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. +