Search Postgresql Archives

Re: bug regclass::oid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/17/19 1:58 AM, John Mikel wrote:

hi again


here is my query
*select   A.table_name  as "table_name",A.domain_name as "domain",*
* format_type(c.atttypid, c.atttypmod)  AS data_type ,A.column_name as "column_name",*
*  A.is_nullable as "nullable",A.column_default as "default"*
*  from information_schema.columns A inner  join pg_attribute c  on  a.table_name::regclass::oid=c.attrelid* *  where  a.table_schema in (select current_schema()) and  a.column_name =c.attname ;*

if i run this query in any database contain at least one table with space in their name , an error will occur
if i run this query in other database will work fine
I tested this on pg 11.1  , pg 10.3, pg 9.6

PS:Sorry if this message is duplicated i canceled the previous message by mistake by clicking on link


The previous message came through, see the replies. The basic issue is that a table name with a space in it will need to be quoted. So use quote_ident() per Peter and Tom's suggestions.


--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux