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

Re: [HACKERS] create type error message

2006-03-22 Thread Tom Lane
"Jim Buttafuoco" <[EMAIL PROTECTED]> writes: > # create type a as (a text,b int); > CREATE TYPE > # create type a as (a text,b int); > ERROR: relation "a" already exists > seems like > ERROR: type "a" already exists > would be better. It's not really all that easy, because tables and composite

[HACKERS] create type error message

2006-03-22 Thread Jim Buttafuoco
# select version(); version PostgreSQL 8.1.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.5 (Debian 1:3.3.5-13) (1 row) simple example: # create type a a

Re: [HACKERS] CREATE TYPE with two args

2004-11-08 Thread Peter Eisentraut
Ameen - Etemady wrote: > I want to create a data type that have tow arguments in the > defenition, like the varchar type: This is not possible. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Don't 'ki

[HACKERS] CREATE TYPE with two args

2004-11-08 Thread Ameen - Etemady
I want to create a data type that have tow arguments in the defenition, like the varchar type: create table mytmp(name varchar(10)); I like to do it like this: create table mytmp(name myvarchar(10,"en_US")); how can it be done by "CREATE TYPE" I want to implement the internal functions (compare,

Re: [HACKERS] create type: recv and send function

2004-05-14 Thread Tom Lane
Gaetano Mendola <[EMAIL PROTECTED]> writes: > what is the purpose of two function send and receive > when a new type is defined ? Binary I/O handling. I'm quite sure this is in the docs... regards, tom lane ---(end of broadcast)---

[HACKERS] create type: recv and send function

2004-05-14 Thread Gaetano Mendola
Hi all, what is the purpose of two function send and receive when a new type is defined ? When these two functions are called ? Regards Gaetano Mendola ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

[HACKERS] Create Type Problem

2004-04-06 Thread vinayj
Hi I am newbe so this problem may be too simple to be asked.please help me if any new thing to be added in following: I created data type IndChar The c functions are: typedef struct IndChar { int32 len; char c_in_str[1]; }IndChar; then i defined input & output functions. Input: Datum in

[HACKERS] create type with like

2004-03-28 Thread ivan
hi, we can create table using LIKE syntax , so i think we could create type with LIKE, its quite this same, ?? bye ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [HACKERS] CREATE TYPE for case insensitive text and varchar

2003-10-30 Thread Jan Wieck
Tom Lane wrote: Daniel Migowski <[EMAIL PROTECTED]> writes: I miss the possibility to code something like a userdifined varchar(n). You're out of luck on that. The data types that can have precision parameters attached to them are hard-wired into the parser. Maybe you don't need to invent a whole

Re: [HACKERS] CREATE TYPE for case insensitive text and varchar

2003-10-30 Thread Tom Lane
Daniel Migowski <[EMAIL PROTECTED]> writes: > I miss the possibility to code something like a userdifined > varchar(n). You're out of luck on that. The data types that can have precision parameters attached to them are hard-wired into the parser. regards, tom lane --

[HACKERS] CREATE TYPE for case insensitive text and varchar

2003-10-30 Thread Daniel Migowski
Hallo. i just coded a new datatype named "cistring", that can be used in every function that accepts text or varchar, and has the great ability to be ordered case insensitive in ORDER BY- Clauses and Indices. The problem is, that its coded like the text-type, so it is variable length completly.

Re: [HACKERS] CREATE TYPE

2003-08-16 Thread Christopher Browne
A long time ago, in a galaxy far, far away, [EMAIL PROTECTED] (ivan) wrote: > Can you add LIKE TO CREATE TYPE too ? There could be > also CREATE TYPE ble AS ( LIKE CREATE TABLE ble ( LIKE ) , and each colmnu from compose > type will be add to table "ble" with static (NOT) NULL, and without > de

[HACKERS] CREATE TYPE

2003-08-16 Thread ivan
Can you add LIKE TO CREATE TYPE too ? There could be also CREATE TYPE ble AS ( LIKE ) , and each colmnu from compose type will be add to table "ble" with static (NOT) NULL, and without defaults. what do you think ? ---(end of broadcast)--- TIP 3:

Re: [HACKERS] CREATE TYPE

2003-07-19 Thread mallah
sorry i was not the rite person to answer at the first place. wait for other hacker to help ya. regds mallah. > OK - i've got the basic input/output working now - but how to I do the > extent bit ? > eg. allow : > > create table ( > something a4gl_datime(15) > ) > > > On Friday 18 July

Re: [HACKERS] CREATE TYPE

2003-07-18 Thread Mike Aubury
OK - i've got the basic input/output working now - but how to I do the extent bit ? eg. allow : create table ( something a4gl_datime(15) ) On Friday 18 July 2003 6:53 pm, [EMAIL PROTECTED] wrote: > Programmers Guide , Chap 10 > http://www.postgresql.org/docs/7.3/static/xtypes.html > > c

Re: [HACKERS] CREATE TYPE

2003-07-18 Thread mallah
Programmers Guide , Chap 10 http://www.postgresql.org/docs/7.3/static/xtypes.html contrib/isbn_issn also provides an implementation example. regds mallah. > Can someone point me at some detailed instructions for creating new > datatypes.. > > I've found quite a few web pages that mention it (in

[HACKERS] CREATE TYPE

2003-07-18 Thread Mike Aubury
Can someone point me at some detailed instructions for creating new datatypes.. I've found quite a few web pages that mention it (in passing) and give brief examples - but nothing much I can actually work with for my purposes.. Ideally I'd like to use C as the language and the datatype will nee