Thread: pgAdmin3 NO INHERIT syntax error ?

pgAdmin3 NO INHERIT syntax error ?

From
Thomas Joseph
Date:
Hi All,

This is my first week with PostgreSQL and pgAdmin.
So, I am not even sure if this is an erroneous situation.

I am using Postgresql-9.2.2-1-windows.exe installer and the pgAdmin3 came with it.
To interact with PG,  I am entirely dependent on pgAdmin.
Thanks for making the life a lot easier with pgAdmin.

The SQLs below are just copy-n-paste from the pgAdmin SQL tab.

Created a table:

CREATE TABLE public.my_table
(
 primary_key serial NOT NULL,
  order_code character(8),
  order_date date,
  CONSTRAINT my_table_pkey PRIMARY KEY (primary_key)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE public.my_table
  OWNER TO me;


Then created an inherited table:

CREATE TABLE public.my_table_new
(
   CONSTRAINT my_table_new PRIMARY KEY (primary_key_new)
INHERITS (my_table)
WITH (
  OIDS = FALSE
)
;
ALTER TABLE public.my_table_new
  OWNER TO me;

Now I wanted to to delete the inheritance:
For that, I chose the properties of the table, deleted the my_table entry that was under inherits tab, 
the SQL tab shows the following:

ALTER TABLE my_table_newmy_table
  NO INHERIT;

I believe it should be,
 
ALTER TABLE my_table_new
NO INHERIT my_table;

Thomas ./

Re: pgAdmin3 NO INHERIT syntax error ?

From
Guillaume Lelarge
Date:
Hi,

On Thu, 2013-01-03 at 13:25 +0800, Thomas Joseph wrote:
> [...]
> This is my first week with PostgreSQL and pgAdmin.
> So, I am not even sure if this is an erroneous situation.
> 
> I am using Postgresql-9.2.2-1-windows.exe installer and the pgAdmin3 came with it.
> To interact with PG,  I am entirely dependent on pgAdmin.
> Thanks for making the life a lot easier with pgAdmin.
> 
> The SQLs below are just copy-n-paste from the pgAdmin SQL tab.
> 
> Created a table:
> 
> CREATE TABLE public.my_table
> (
>  primary_key serial NOT NULL,
>   order_code character(8),
>   order_date date,
>   CONSTRAINT my_table_pkey PRIMARY KEY (primary_key)
> )
> WITH (
>   OIDS=FALSE
> );
> ALTER TABLE public.my_table
>   OWNER TO me;
> 
> 
> Then created an inherited table:
> 
> CREATE TABLE public.my_table_new
> (
>    CONSTRAINT my_table_new PRIMARY KEY (primary_key_new)
> ) 
> INHERITS (my_table)
> WITH (
>   OIDS = FALSE
> )
> ;
> ALTER TABLE public.my_table_new
>   OWNER TO me;
> 
> Now I wanted to to delete the inheritance:
> For that, I chose the properties of the table, deleted the my_table entry that was under inherits tab, 
> the SQL tab shows the following:
> 
> ALTER TABLE my_table_newmy_table
>   NO INHERIT;
> 
> I believe it should be,
>  
> ALTER TABLE my_table_new
> NO INHERIT my_table;
> 

I believe you're right. This is a bug. I pushed a fix.

Thanks for your report.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com