Unix Technical Forum

SQL display of inheriting tables wrong

This is a discussion on SQL display of inheriting tables wrong within the pgsql Interfaces Pgadmin Hackers forums, part of the PostgreSQL category; --> The SQL visualization of tables that inherit from another table is wrong in pgAdmin. You can check that with ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:57 PM
Peter Eisentraut
 
Posts: n/a
Default SQL display of inheriting tables wrong

The SQL visualization of tables that inherit from another table is wrong in
pgAdmin. You can check that with the table "emp" in the regression test
database. The actual definition (as produced by pg_dump) is this:

CREATE TABLE person (
name text,
age integer,
"location" point
);

CREATE TABLE emp (
salary integer,
manager name
)
INHERITS (person);


pgAdmin produces this:

CREATE TABLE emp
(
name text,
age int4,
"location" point,
salary int4,
manager name
) INHERITS (person)
WITH OIDS;

While this also works (the common columns are merged), executing this and
redumping it with pg_dump produces this:

CREATE TABLE emp (
name text,
age integer,
"location" point,
salary integer,
manager name
)
INHERITS (person);

which is not the same we started out with.

I'm not exactly sure what is going on here, but it's confusing.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 05:57 PM
Andreas Pflug
 
Posts: n/a
Default Re: SQL display of inheriting tables wrong

Peter Eisentraut wrote:
> The SQL visualization of tables that inherit from another table is wrong in
> pgAdmin. You can check that with the table "emp" in the regression test
> database. The actual definition (as produced by pg_dump) is this:


> CREATE TABLE emp (
> name text,
> age integer,
> "location" point,
> salary integer,
> manager name
> )
> INHERITS (person);
>
> which is not the same we started out with.
>
> I'm not exactly sure what is going on here, but it's confusing.


The columns are probably overloaded.
The table code didn't obey the column's inherit flag, fixed in SVN for
HEAD and 1.4, thanks for reporting.

We didn't catch trying to edit an inherited column from the table
dialog; corrected now too.

Regards,
Andreas


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:57 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com