Re: bug regclass::oid

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: John Mikel <blpmftat(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: bug regclass::oid
Date: 2019-06-13 15:33:18
Message-ID: fc6a3ada-db64-a6e1-b5d7-4f4b2882eb4c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/13/19 8:14 AM, John Mikel wrote:
> * hi ,
>  i am here to tell you that this  test in query is not working when the
>  table name in the database or schema name   contain space
>  a.table_name::regclass=b.attrelid
>
>  a is information_schema.columns
>  b is pg_attribute
>
>  trying this in two different databases the first database contain table
>  with space in his name (Problem when running query)
>  the second no ( work fine)
>
>  the same problme if you get Oid from schema name.
>  SELECT 'public'::regnamespace::oid;  work ;
>  create schema " this is test" ;
>  SELECT 'this is test'::regnamespace::oid;  not working ;

Try:

SELECT '"this is test"'::regnamespace::oid; not working ;

Same for table name. As example:

select '"space table"'::regclass;
regclass
---------------
"space table"
(1 row)

>
>  i have question how use join between  information_schema.columns and
>  pg_attribute ? thanks
>
> regards*

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sourav Majumdar 2019-06-13 16:56:42 Re: Connection refused (0x0000274D/10061)
Previous Message John Mikel 2019-06-13 15:14:46 bug regclass::oid