pg_tables query issue

Поиск
Список
Период
Сортировка
Искать

pg_tables query issue

От:
kevin kempter <kevin@kevinkempterllc.com>
Дата:
Hi List;

I've found that if I run this select (below) I get a table returned  
named 'dma' een though I specified like 'dm_%' :


select tablename from pg_tables where tablename like 'dm_%';


           tablename
------------------------------
  dm_service_provider_dim
  dma


Am I missing something or is this a bug ?

Thanks in advance..

/Kevin





Re: pg_tables query issue

От:
Stephan Szabo <sszabo@megazone.bigpanda.com>
Дата:

> I've found that if I run this select (below) I get a table returned
> named 'dma' een though I specified like 'dm_%' :

Underscore is a special character for like matching any single character
so I don't think that's wrong.

Re: pg_tables query issue

От:
kevin kempter <kevin@kevinkempterllc.com>
Дата:
OK. Thanks for the info.


On Jun 30, 2008, at 5:48 PM, Stephan Szabo wrote:

>
>> I've found that if I run this select (below) I get a table returned
>> named 'dma' een though I specified like 'dm_%' :
>
> Underscore is a special character for like matching any single  
> character
> so I don't think that's wrong.
>
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin

Re: pg_tables query issue

От:
Lennin Caro <lennin.caro@yahoo.com>
Дата:
Hi List;

I've found that if I run this select (below) I get a table returned  
named 'dma' een though I specified like 'dm_%' :


select tablename from pg_tables where tablename like 'dm_%';


           tablename
------------------------------
  dm_service_provider_dim
  dma


Am I missing something or is this a bug ?


Thanks in advance..


/Kevin





>> the '_' character is a especial character like the '%'.... Try use this

>>select * from table where name ilike('dm\\_%') 




      

FAQ