Alvaro

Siguio sin andar pero siguiendo tu indicacion tambien castee la otra
expresion y anduvo :D

indexrelname::regclass

quedo asi ( y anda, no da error. )
SELECT idstat.relname AS table_name,
indexrelname AS index_name,
idstat.idx_scan AS times_used,
pg_size_pretty(pg_relation_size(idstat.relname::regclass )) AS
table_size, pg_size_pretty(pg_relation_size(indexrelname::regclass))
AS index_size,
n_tup_upd + n_tup_ins + n_tup_del as num_writes,
indexdef AS definition
FROM pg_stat_user_indexes AS idstat JOIN pg_indexes ON indexrelname = indexname
JOIN pg_stat_user_tables AS tabstat ON idstat.relname = tabstat.relname
WHERE idstat.idx_scan < 200
AND indexdef !~* 'unique'
ORDER BY idstat.relname, indexrelname;

salu2
mdc



2010/8/30 Alvaro Herrera <alvhe...@commandprompt.com>:
> Excerpts from Juan's message of lun ago 30 12:35:37 -0400 2010:
>
>> ERROR:  no existe la función pg_relation_size(name)
>> LINE 4: pg_size_pretty(pg_relation_size(idstat.relname)) AS table_si...
>>                        ^
>> HINT:  Ninguna función coincide en el nombre y tipos de argumentos.
>> Puede desear agregar conversión explícita de tipos.
>>
>> select version() me devuelbve esto en mi pgadmin
>>
>> "PostgreSQL 8.4.4, compiled by Visual C++ build 1400, 32-bit"
>>
>> SERA QUE ESA QUERY ES PARA UNA VERSON MAS VIEJA?
>
> vaya, que raro.  Agrega un cast a regclass:
>
> ... pg_size_pretty(pg_relation_size(idstat.relname::regclass)) AS ...
>
> Creo que el Wiki necesita una correccion.
>
> --
> Álvaro Herrera <alvhe...@commandprompt.com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>
-
Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda@postgresql.org)
Para cambiar tu suscripción:
http://www.postgresql.org/mailpref/pgsql-es-ayuda

Reply via email to