pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Yasir Malik <ymalik@cs.stevens-tech.edu>
Cc: PostgreSQL <pgsql-sql@postgresql.org>
Subject: Re: inserting values into types
Date: Sun, 5 Dec 2004 21:03:24 -0700
Message-ID: <20041206040324.GA48287@winnie.fuhr.org> (raw)
In-Reply-To: <Pine.NEB.4.60.0412042310560.7853@dab.cs.stevens-tech.edu>
References: <20041201215811.476CF23CE8@ws5-3.us4.outblaze.com>
	<20041201234311.L622@hermes.hilbert.loc>
	<Pine.NEB.4.60.0412042310560.7853@dab.cs.stevens-tech.edu>

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/



view thread (8+ messages)

Message-ID: <20041206040324.GA48287@winnie.fuhr.org>
Permalink:  ../20041206040324.GA48287@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20041206040324.GA48287@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, ymalik@cs.stevens-tech.edu
  Subject: Re: inserting values into types
  In-Reply-To: <20041206040324.GA48287@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox