ENUM type script in pgAdmin 1.14.0

Поиск
Список
Период
Сортировка
Искать

ENUM type script in pgAdmin 1.14.0

От:
"bdmytrak@eranet.pl" <bdmytrak@eranet.pl>
Дата:
Hi All,
I think there is a bug in "CREATE" script for ENUM types created in public schema. 
When You execute command:
CREATE TYPE public."MyEnum" AS ENUM
   ('first','second', 'middle', 'last');

and You use "Create Script" functionality in pgAdmin, the script looks like this:
-- Type: "MyEnum"
-- DROP TYPE "MyEnum";
CREATE TYPE "MyEnum" AS ENUM
   ('first',
    'second',
    'middle',
    'last');
ALTER TYPE "MyEnum"
  OWNER TO postgres;

It seems there is no schema qualified name. It appears regardles search_patch setting. I've  tried in different schema and every thing was OK.

This is my fist post, so please don't yell on me ;)

regards,
Bartek 

Re: ENUM type script in pgAdmin 1.14.0

От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:
On Sun, 2011-09-25 at 23:13 +0200, bdmytrak@eranet.pl wrote:
> Hi All,
> I think there is a bug in "CREATE" script for ENUM types created in public schema.
> When You execute command:
> CREATE TYPE public."MyEnum" AS ENUM
> ('first','second', 'middle', 'last');
> and You use "Create Script" functionality in pgAdmin, the script looks like this:
> -- Type: " MyEnum "
> -- DROP TYPE " MyEnum ";
> CREATE TYPE " MyEnum " AS ENUM
> (' first ',
> ' second ',
> ' middle ',
> ' last ' );
> ALTER TYPE " MyEnum "
> OWNER TO postgres;
> It seems there is no schema qualified name. It appears regardles search_patch setting. I've tried in different schema and every thing was OK.

It works for me. I get this:

CREATE TYPE "a b"."a strange datatype" AS ENUM  ('a',   'b',   'c',   'd');

if the schema "a b" is not in my search_path (at connection time).

> This is my fist post, so please don't yell on me ;)

We don't yell at people (at lest, most of the time :) ).


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


Re: ENUM type script in pgAdmin 1.14.0

От:
"bdmytrak@eranet.pl" <bdmytrak@eranet.pl>
Дата:
Thanks for reply,

Maybe my post was not clear, but this bug occures only for public schema.
Please try create enum in "public" not in "a b"

Regards,
Bartek


Pozdrawiam,
Bartek

--- Oryginalna wiadomość ---

Od: Guillaume Lelarge [mailto: guillaume@lelarge.info]
Wysłane: Monday, September 26, 2011 09:02 AM
Do: bdmytrak@eranet.pl
Kopia: pgadmin-support@postgresql.org
Temat: Re: [pgadmin-support] ENUM type script in pgAdmin 1.14.0
On Sun, 2011-09-25 at 23:13 +0200, bdmytrak@eranet.pl wrote:
> Hi All,
> I think there is a bug in "CREATE" script for ENUM types created in public schema.
> When You execute command:
> CREATE TYPE public."MyEnum" AS ENUM
> ('first','second', 'middle', 'last');
> and You use "Create Script" functionality in pgAdmin, the script looks like this:
> -- Type: " MyEnum "
> -- DROP TYPE " MyEnum ";
> CREATE TYPE " MyEnum " AS ENUM
> (' first ',
> ' second ',
> ' middle ',
> ' last ' );
> ALTER TYPE " MyEnum "
> OWNER TO postgres;
> It seems there is no schema qualified name. It appears regardles search_patch setting. I've tried in different schema and every thing was OK.

It works for me. I get this:

CREATE TYPE "a b"."a strange datatype" AS ENUM
('a',
'b',
'c',
'd');

if the schema "a b" is not in my search_path (at connection time).

> This is my fist post, so please don't yell on me ;)

We don't yell at people (at lest, most of the time :) ).


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


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

Re: ENUM type script in pgAdmin 1.14.0

От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:
On Mon, 2011-09-26 at 09:07 +0200, bdmytrak@eranet.pl wrote:
> Thanks for reply,
> Maybe my post was not clear, but this bug occures only for public schema.
> Please try create enum in "public" not in "a b"

public is most likely in your search_path, so pgAdmin won't display it.
pgAdmin only displays the schema when it's not in your search_path.


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


Re: ENUM type script in pgAdmin 1.14.0

От:
"bdmytrak@eranet.pl" <bdmytrak@eranet.pl>
Дата:
My search_path is set to "$user", pg_temp
so I think script should contain full definition regardles search_path settings (which could change during DB life cycle).

Regards
Bartek


Pozdrawiam,
Bartek

--- Oryginalna wiadomość ---

Od: Guillaume Lelarge [mailto: guillaume@lelarge.info]
Wysłane: Monday, September 26, 2011 09:12 AM
Do: bdmytrak@eranet.pl
Kopia: pgadmin-support@postgresql.org
Temat: Re: [pgadmin-support] ENUM type script in pgAdmin 1.14.0
On Mon, 2011-09-26 at 09:07 +0200, bdmytrak@eranet.pl wrote:
> Thanks for reply,
> Maybe my post was not clear, but this bug occures only for public schema.
> Please try create enum in "public" not in "a b"

public is most likely in your search_path, so pgAdmin won't display it.
pgAdmin only displays the schema when it's not in your search_path.


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


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

Re: ENUM type script in pgAdmin 1.14.0

От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:
On Mon, 2011-09-26 at 09:33 +0200, bdmytrak@eranet.pl wrote:
> My search_path is set to "$user", pg_temp

I tried, and it works for me. I see the public schema in the definition
of my type.

Best thing to do is open the query tool, and launch "show search_path".
And I'm pretty sure you'll find the public schema in it.

> so I think script should contain full definition regardles search_path settings (which could change during DB life cycle).

Yes and no. We could add an option to always view the schema, regardless
of the search_path setting. But one should be able to enable/disable
this behaviour.


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


Re: ENUM type script in pgAdmin 1.14.0

От:
Bartosz Dmytrak <bdmytrak@eranet.pl>
Дата:
I made double check (both Win and Linux).
This time everything is OK - schema name is included in script.
This is a little strange for me, because previous script has been copied from script output (without schema name). Right now I cannot reproduce this bug(?) again.

Thanks for Your time.

Regards,
Bartek


2011/9/26 Guillaume Lelarge <guillaume@lelarge.info>
On Mon, 2011-09-26 at 09:33 +0200, bdmytrak@eranet.pl wrote:
> My search_path is set to "$user", pg_temp

I tried, and it works for me. I see the public schema in the definition
of my type.

Best thing to do is open the query tool, and launch "show search_path".
And I'm pretty sure you'll find the public schema in it.

> so I think script should contain full definition regardles search_path settings (which could change during DB life cycle).

Yes and no. We could add an option to always view the schema, regardless
of the search_path setting. But one should be able to enable/disable
this behaviour.

FAQ