pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #8405: user can create a system table(eg, pg_class)
2+ messages / 2 participants
[nested] [flat]

* BUG #8405: user can create a system table(eg, pg_class)
@ 2013-08-28 02:01 syxjxia@gmail.com
  2013-08-28 15:27 ` Re: BUG #8405: user can create a system table(eg, pg_class) Heikki Linnakangas <hlinnakangas@vmware.com>
  0 siblings, 1 reply; 2+ messages in thread

From: syxjxia@gmail.com @ 2013-08-28 02:01 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      8405
Logged by:          xjxia
Email address:      syxjxia@gmail.com
PostgreSQL version: 9.2.2
Operating system:   ubuntu11.04 x86_64
Description:        

postgres=# create table pg_class(a int);
CREATE TABLE
postgres=# insert into pg_class values (1);
ERROR:  null value in column "relnamespace" violates not-null constraint
DETAIL:  Failing row contains (1, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null).
postgres=# 



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #8405: user can create a system table(eg, pg_class)
  2013-08-28 02:01 BUG #8405: user can create a system table(eg, pg_class) syxjxia@gmail.com
@ 2013-08-28 15:27 ` Heikki Linnakangas <hlinnakangas@vmware.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2013-08-28 15:27 UTC (permalink / raw)
  To: syxjxia@gmail.com; +Cc: pgsql-bugs

On 28.08.2013 05:01, syxjxia@gmail.com wrote:
> postgres=# create table pg_class(a int);
> CREATE TABLE
> postgres=# insert into pg_class values (1);
> ERROR:  null value in column "relnamespace" violates not-null constraint
> DETAIL:  Failing row contains (1, null, null, null, null, null, null, null,
> null, null, null, null, null, null, null, null, null, null, null, null,
> null, null, null, null, null, null, null).

That's not a bug. The table created is in the public schema, while all 
the system tables are in pg_catalog schema. Yes, it's possible to create 
a table in another schema with the same name. To avoid hijacking 
applications that access the system tables, pg_catalog is implicitly in 
front of search_path, if it's not listed there explicitly. So when you 
do the insert, it refers to pg_catalog.pg_class.

- Heikki


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-08-28 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-08-28 02:01 BUG #8405: user can create a system table(eg, pg_class) syxjxia@gmail.com
2013-08-28 15:27 ` Heikki Linnakangas <hlinnakangas@vmware.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox