Thread: TkSql and pg_group...

TkSql and pg_group...

From
Sandro Dentella
Date:
I noticed only today that postgreSQL 7.2 changed the structure of certain tables like pg_group, that now are no loger
editableby my tksql. The reason is that if TkSql cannot find any of:   1. primary key   2. unique not null   3. oid
switchesto read-only mode. 
 
 pg_group has only unique key and no oid so that for example you can enter several times a line like:  insert into
pg_group(grolist) values ('{27}');
 
 This is very strange to me, and I'd like to understand it better, moreover I'd like to understand how should an editor
copewith this case: I'd like to make tksql able to edit these tables too, but I see no way to act on a record in a
uniqueway.
 
 Thanks in advance sandro *:-)

-- 
Sandro Dentella  *:-)
e-mail: sandro.dentella@tin.it 
http://www.tksql.org                    TkSQL Home page - My GPL work




Re: TkSql and pg_group...

From
Tom Lane
Date:
Sandro Dentella <sandro.dentella@tin.it> writes:
>   I'd like to understand how should an editor cope with this case: I'd like
>   to make tksql able to edit these tables too, but I see no way to act on a
>   record in a unique way.

You should not be editing system catalogs with INSERT/UPDATE/DELETE
operations in any case.

This points up that the initdb process is pretty lax about marking
catalog columns NOT NULL, even though essentially all fixed-width
columns in the catalogs are in fact expected to not be null ...
        regards, tom lane




Re: TkSql and pg_group...

From
Sandro Dentella
Date:
On Sun, Jul 07, 2002 at 12:34:05PM -0400, Tom Lane wrote:
> Sandro Dentella <sandro.dentella@tin.it> writes:
> >   I'd like to understand how should an editor cope with this case: I'd like
> >   to make tksql able to edit these tables too, but I see no way to act on a
> >   record in a unique way.
> 
> You should not be editing system catalogs with INSERT/UPDATE/DELETE
> operations in any case.
> 

This was not true till 7.1 before CREATE GROUP command, correct?
You're suggesting tksql should set read-only any system catalogs, and let
people change them w/ other means?

How are system catalogs recognizable (apart from leading pg_ that a user
could put to other table names...)

TYA

sandro
*:-)

-- 
Sandro Dentella  *:-)
e-mail: sandro.dentella@tin.it 
http://www.tksql.org                    TkSQL Home page - My GPL work




Re: TkSql and pg_group...

From
"Ross J. Reedstrom"
Date:
On Mon, Jul 08, 2002 at 01:04:47PM +0200, Sandro Dentella wrote:
> On Sun, Jul 07, 2002 at 12:34:05PM -0400, Tom Lane wrote:
> 
> How are system catalogs recognizable (apart from leading pg_ that a user
> could put to other table names...)

You sure?

test=# create table pg_foo (a int, b text);
ERROR:  invalid relation name "pg_foo"; the 'pg_' name prefix is reserved for system catalogs

Ross




Re: TkSql and pg_group...

From
Sandro Dentella
Date:
On Mon, Jul 08, 2002 at 12:55:04PM -0500, Ross J. Reedstrom wrote:
> On Mon, Jul 08, 2002 at 01:04:47PM +0200, Sandro Dentella wrote:
> > On Sun, Jul 07, 2002 at 12:34:05PM -0400, Tom Lane wrote:
> > 
> > How are system catalogs recognizable (apart from leading pg_ that a user
> > could put to other table names...)
> 
> You sure?
> 
> test=# create table pg_foo (a int, b text);
> ERROR:  invalid relation name "pg_foo"; the 'pg_' name prefix is reserved for system catalogs
> 
> Ross

Ops!... thanks

*:-)

-- 
Sandro Dentella  *:-)
e-mail: sandro.dentella@tin.it 
http://www.tksql.org                    TkSQL Home page - My GPL work