Re: How to check is the table system

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: ???????????? <andyk(at)softwarium(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to check is the table system
Date: 2005-09-18 13:59:07
Message-ID: 20050918135907.GR7630@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-09-18 14:08:47 Re: BIG installations of PostgresQL?
Previous Message Neil Dugan 2005-09-18 11:56:14 Re: Asychronous database replication