dbTalk Databases Forums  

Re: [BUGS] BUG #2852: User-defined type name begins with the

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #2852: User-defined type name begins with the in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #2852: User-defined type name begins with the - 12-22-2006 , 07:29 PM







--ELM1166837311-28574-2_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="US-ASCII"


I have applied the following documentaiton patch that states a leading
underscore "shouldn't" be used, rather than prohibited.

---------------------------------------------------------------------------

Pavel Golub wrote:
Quote:
The following bug has been logged online:

Bug reference: 2852
Logged by: Pavel Golub
Email address: pavel (AT) microolap (DOT) com
PostgreSQL version: 8.x
Operating system: Windows XP
Description: User-defined type name begins with the underscore
character (_) can be created
Details:

Hello, pgsql-bugs.

Documentation says:
"User-defined type names cannot begin with the
underscore character (_) and can only be 62
characters long (or in general NAMEDATALEN - 2,
rather than the NAMEDATALEN - 1 characters
allowed for other names). Type names beginning
with underscore are reserved for
internally-created array type names. "

However, such SQL may be executed:

CREATE TYPE _my AS (id int4, id2 int4);

And then server treats it as an array type. Thus next SQL will be executed
too:

CREATE TABLE my_table(
my_arr my[]
);

Checked on PostgreSQL versions (Windows XP):
8.0.6
8.1.0
8.2.0

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org
--
Bruce Momjian bruce (AT) momjian (DOT) us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

--ELM1166837311-28574-2_
Content-Transfer-Encoding: 7bit
Content-Type: text/x-diff
Content-Disposition: inline; filename="/rtmp/diff"

Index: doc/src/sgml/ref/create_type.sgml
================================================== =================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v
retrieving revision 1.64
diff -c -c -r1.64 create_type.sgml
*** doc/src/sgml/ref/create_type.sgml 16 Sep 2006 00:30:17 -0000 1.64
--- doc/src/sgml/ref/create_type.sgml 23 Dec 2006 01:05:31 -0000
***************
*** 452,459 ****
<title>Notes</title>

<para>
! User-defined type names cannot begin with the underscore character
! (<literal>_</literal>) and can only be 62 characters
long (or in general <symbol>NAMEDATALEN</symbol> - 2, rather than
the <symbol>NAMEDATALEN</symbol> - 1 characters allowed for other
names). Type names beginning with underscore are reserved for
--- 452,459 ----
<title>Notes</title>

<para>
! User-defined type names should not begin with the underscore character
! (<literal>_</literal>) and should only be 62 characters
long (or in general <symbol>NAMEDATALEN</symbol> - 2, rather than
the <symbol>NAMEDATALEN</symbol> - 1 characters allowed for other
names). Type names beginning with underscore are reserved for

--ELM1166837311-28574-2_
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

--ELM1166837311-28574-2_--


Reply With Quote
  #2  
Old   
Pavel Golub
 
Posts: n/a

Default Re: [BUGS] BUG #2852: User-defined type name begins with the - 12-25-2006 , 01:52 AM






Hello, Bruce.

Thanks for an answer. Are there any thoughts to insert check into
PostgreSQL code or we (developers) must take into account that UDT
with leading underscore may exist?

You wrote:

BM> I have applied the following documentaiton patch that states a leading
BM> underscore "shouldn't" be used, rather than prohibited.

BM> ---------------------------------------------------------------------------

BM> Pavel Golub wrote:
Quote:
The following bug has been logged online:

Bug reference: 2852
Logged by: Pavel Golub
Email address: pavel (AT) microolap (DOT) com
PostgreSQL version: 8.x
Operating system: Windows XP
Description: User-defined type name begins with the underscore
character (_) can be created
Details:

Hello, pgsql-bugs.

Documentation says:
"User-defined type names cannot begin with the
underscore character (_) and can only be 62
characters long (or in general NAMEDATALEN - 2,
rather than the NAMEDATALEN - 1 characters
allowed for other names). Type names beginning
with underscore are reserved for
internally-created array type names. "

However, such SQL may be executed:

CREATE TYPE _my AS (id int4, id2 int4);

And then server treats it as an array type. Thus next SQL will be executed
too:

CREATE TABLE my_table(
my_arr my[]
);

Checked on PostgreSQL versions (Windows XP):
8.0.6
8.1.0
8.2.0

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org



--
With best wishes,
Pavel mailtoavel (AT) microolap (DOT) com


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.