From: | "Gilberto Castillo" <gilberto(dot)castillo(at)etecsa(dot)cu> |
---|---|
To: | "Francisco Olarte" <folarte(at)peoplecall(dot)com> |
Cc: | "mauricio pullabuestan" <jmauriciopb(at)yahoo(dot)es>, "Lista Postgres ES" <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: [MASSMAIL] Re: Nuevo campo en todas las tablas de la base de datos |
Date: | 2016-04-13 12:34:07 |
Message-ID: | 35993.192.168.207.54.1460550847.squirrel@webmail.etecsa.cu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
> Buenos dias:
>
> On Wed, Apr 13, 2016 at 12:33 AM, mauricio pullabuestan
> <jmauriciopb(at)yahoo(dot)es> wrote:
>> Necesito crear un campo en todas que no tengan un campo en concreto para
>> ello tengo 2 funciones, el problema se da es que la funcion
>> campo_check_fnc me devuelve también las vista y se produce un error.
>> Como puedo fitrar que solo me devuelva tablas.
>
> Asi por encima tu problema parece ser que seleccionas de donde no
> debes ( o para ser exacto no seleccionas de todos los sitios donde
> debes ):
>
>> SELECT table_schema, table_name
>> FROM information_schema.columns
> ...
>> SELECT table_schema, table_name, column_name = 'mi_campo' As
>> existe_campo
>> FROM information_schema.columns
> ...
>
> Si vas a las docs veras ( lo siento, en ingles, no se donde estan las
> docs en español ):
>
> http://www.postgresql.org/docs/9.5/static/infoschema-columns.html
La doc en español esta acá, solo espera por la constribución de nosotros
en la traducción: http://pootle.postgresql.org.ar/pootle
>
> 34.16. columns
>
> The view columns contains information about all table columns (or view
> columns) in the database. System columns (oid, etc.) are not included.
> Only those columns are shown that the current user has access to (by
> way of being the owner or having some privilege).
>
> Prueba a hacer un join con tables para coger solo las tablas:
>
> http://www.postgresql.org/docs/9.5/static/infoschema-tables.html
>
> 34.52. tables
>
> The view tables contains all tables and views defined in the current
> database. Only those tables and views are shown that the current user
> has access to (by way of being the owner or having some privilege).
> ....
> table_type - character_data - Type of the table: BASE TABLE for a
> persistent base table (the normal table type), VIEW for a view,
> FOREIGN TABLE for a foreign table, or LOCAL TEMPORARY for a temporary
> table
>
> ( Podrias probar a hacer un not exists o u nouter join filtrado con
> views, pero creo que tables.table_type te dara mejor resultado ya que
> te permite decidir que hacer con las FOREIGN TABLE y/o TEMPORARY TABLE
> ).
>
>
> Fancisco Olarte.
>
> -
> Enviado a la lista de correo pgsql-es-ayuda
> (pgsql-es-ayuda(at)postgresql(dot)org)
> Para cambiar tu suscripci�n:
> http://www.postgresql.org/mailpref/pgsql-es-ayuda
>
--
Saludos,
Gilberto Castillo
ETECSA, La Habana, Cuba
-
Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda(at)postgresql(dot)org)
Para cambiar tu suscripcin:
http://www.postgresql.org/mailpref/pgsql-es-ayuda
From | Date | Subject | |
---|---|---|---|
Next Message | Jorge Gonzalez | 2016-04-13 13:06:55 | Re: Nuevo campo en todas las tablas de la base de datos |
Previous Message | Francisco Olarte | 2016-04-13 09:30:11 | Re: Nuevo campo en todas las tablas de la base de datos |