Re: [HACKERS] create type- similar char

2014-03-16 Thread Tom Lane
Mohsen SM writes: > I create one new type with CREATE TYPE command. > for my type its INTERNALLENGTH is VARIABLE . > but I want to my type behavior similar to char and when I type this query: > CREATE TABLE tbl (col1 NEWTYPE); > then when I write this query, so it get an error for it's length: >

Re: [HACKERS] create type- similar char

2014-03-16 Thread Pavel Stehule
Hello I don't know where is a problem, but I can put a two advices a) start by extending some known extension b) look to source code, where and why a exception was raised. Verbose mode can help [pavel@localhost ~]$ psql postgres psql (9.4devel) Type "help" for help. postgres=# \set VERBOSITY v

[HACKERS] create type- similar char

2014-03-16 Thread Mohsen SM
I create one new type with CREATE TYPE command. for my type its INTERNALLENGTH is VARIABLE . but I want to my type behavior similar to char and when I type this query: CREATE TABLE tbl (col1 NEWTYPE); then when I write this query, so it get an error for it's length: insert into tbl values('dd'); i

Re: [HACKERS] CREATE TYPE similar CHAR type

2014-03-06 Thread David Johnston
mohsencs wrote > I want use CREATE TYPE to create one type similar to char. > I want to when I create type, then my type behave similar to char: > > CREATE TABLE test (oneChar char); > > when I want insert one column with length>1 to it, so it gets this error: > ERROR: value too long for type ch

Re: [HACKERS] CREATE TYPE similar CHAR type

2014-03-06 Thread Thom Brown
On 6 March 2014 11:24, Mohsen SM wrote: > I want use CREATE TYPE to create one type similar to char. > I want to when I create type, then my type behave similar to char: > > CREATE TABLE test (oneChar char); > > when I want insert one column with length>1 to it, so it gets this error: > ERROR: v

[HACKERS] CREATE TYPE similar CHAR type

2014-03-06 Thread Mohsen SM
I want use CREATE TYPE to create one type similar to char. I want to when I create type, then my type behave similar to char: CREATE TABLE test (oneChar char); when I want insert one column with length>1 to it, so it gets this error: ERROR: value too long for type character(1) I want my type be