Ok, I get it. For me your query works fine, don't know what could be the
problem.

$ script/app eval 'say app->pg->db->query("select reltuples from pg_class
where relname = ?", "files")->hash->{reltuples}'
1810
$ script/app eval 'say app->pg->db->query("select reltuples from pg_class
where relname = ?", "files")->arrays->[0][0]'
1810
$ script/app eval 'say app->pg->db->query("select reltuples from pg_class
where relname = ?", "files")->array->[0]'
1810


On Tue, Sep 1, 2015 at 3:56 PM, Neil Watson <[email protected]> wrote:

> On Tue, Sep 01, 2015 at 10:20:43AM +0500, Andrey Khozov wrote:
>
>>
>>
>>   You can use $results->rows for number of rows
>>   ([1]http://mojolicio.us/perldoc/Mojo/Pg/Results#rows)
>>   Or $results->arrays->size
>>   ([2]http://mojolicio.us/perldoc/Mojo/Collection#size) if you want to
>>   load all records to memory.
>>
>
> It's a very large table, that's why I'm getting an rough coutn from
> pg_class.
>
>
>
> --
> Neil Watson
> Linux/UNIX Consultant
> http://watson-wilson.ca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Andrey Khozov

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to