Search Postgresql Archives

Re: How to check is the table system

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

 



On Thu, Sep 15, 2005 at 09:12:44PM +0300, ???????????? wrote:
> Hello!
> 
>    In what way can I determine is the table system? ODBC driver does it 
> by checking table name's prefix: if it begins with 'pg_' - driver 
> desides that the table is system, but that's a bad idea. I can create 
> table and call it 'pg_mytable', but it won't become system!

>From http://lnk.nu/cvs.pgfoundry.org/3yb.sql:
-- Note that generic case would be "select $1 like ''pg!_%'' escape ''!''
create or replace function _pg_sv_system_schema(name) returns boolean
  as 'select $1 in (name ''pg_catalog'', name ''pg_toast'',
                    name ''pg_sysviews'', name ''information_schema'')'
  language sql immutable strict;

create or replace function _pg_sv_temp_schema(name) returns boolean
  as 'select $1 like ''pg!_temp!_%'' escape ''!'' '
  language sql immutable strict;

Of course, as others have mentioned, that won't work if you're pre-schemas.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@xxxxxxxxxxxxx
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[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