Skip site navigation (1) Skip section navigation (2)

Re: inserting values into types

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Yasir Malik <ymalik(at)cs(dot)stevens-tech(dot)edu>
Cc: PostgreSQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: inserting values into types
Date: 2004-12-06 04:03:24
Message-ID: 20041206040324.GA48287@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-sql
On Sat, Dec 04, 2004 at 11:13:29PM -0500, Yasir Malik wrote:
> >>CREATE TYPE qwerty_UDT AS (abc INT);
> >>
> >>CREATE TABLE t (col1 qwerty_UDT);
> >>
> >>INSERT INTO t (col1) VALUES (qwerty_UDT(123));
> >>
> >>ERROR:  function qwerty_udt(integer) does not exist
> >>HINT:  No function matches the given name and argument types. You may 
> >>need to add explicit type casts.
> 
> It seems as though you want to create your own user-defined types.  That 
> isn't easy in PostgreSQL.

That the CREATE TABLE statement succeeded implies that he's using
PostgreSQL 8.0, which has better support for composite types than
previous versions.  What he's trying to do will work -- he just has
the syntax wrong.

http://developer.postgresql.org/docs/postgres/rowtypes.html

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

pgsql-sql by date

Next:From: Paulo AssisDate: 2004-12-06 04:18:22
Subject: Postgesql 8 beta 5: ecpg and date type - Access violations
Previous:From: Ellert van KoperenDate: 2004-12-05 17:48:56
Subject: Making dirty reads possible?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group