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:
>
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
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
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
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
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