Re: Determining the type of an obkect in plperl
От
Rob Sargent
Тема
Re: Determining the type of an obkect in plperl
Дата
Msg-id
4FFE61D4-994C-436C-8624-102D121C4D0C@gmail.com
Ответ на
Список
Дерево обсуждения
Determining the type of an obkect in plperl stan <stanb@panix.com>
Re: Determining the type of an obkect in plperl "David G. Johnston" <david.g.johnston@gmail.com>
Re: Determining the type of an obkect in plperl stan <stanb@panix.com>
Re: Determining the type of an obkect in plperl "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: Determining the type of an obkect in plperl "Ravi Krishna" <srkrishna@gmx.com>
Re: Determining the type of an obkect in plperl stan <stanb@panix.com>
Re: Determining the type of an obkect in plperl stan <stanb@panix.com>
Re: Determining the type of an obkect in plperl Rob Sargent <robjsargent@gmail.com>
> On Mar 5, 2020, at 4:22 AM, stan wrote:
>
> On Thu, Mar 05, 2020 at 12:27:12AM +0000, Ravi Krishna wrote:
>>
>>>
>>> how can I determine what the data type of the value element is?
>>>
>> perl has a ref function which can tell what type of object.
>>
>> https://perldoc.perl.org/functions/ref.html
>>>
>>
>>
>> --
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
> Even checking gisnt teh _TD structure does not return a value:
>
> foreach my $key (sort keys %{$_TD->{old}}) {
> my $ref1 = ref $_TD->{old}->{$key};
> my $ref2 = ref $_TD->{new}->{$key};
> elog(NOTICE, "ref1 = $ref1 ref2 = $ref2" );
> .
> .
>
I’m not a Perl guy but I don’t think you need to sort the keys. You don’t care what order the comparisons are done, do you?
If it’s just “is different” your looking for why can’t you rely on Perl’s type coercing (toString()) on operands of ne? You won’t have different types under the same key.
В списке pgsql-general по дате отправления