pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Andrew Thorley <andrew.thorley@linuxmail.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: inserting values into types
Date: Tue, 30 Nov 2004 17:17:12 -0700
Message-ID: <20041201001711.GA87131@winnie.fuhr.org> (raw)
In-Reply-To: <20041130235117.E60912B2B86@ws5-7.us4.outblaze.com>
References: <20041130235117.E60912B2B86@ws5-7.us4.outblaze.com>

On Wed, Dec 01, 2004 at 07:51:17AM +0800, Andrew Thorley wrote:

> ive generated a user defined type: CREATE TYPE qwerty_UDT AS (abc INT);
> 
> & table as: CREATE TABLE t (col1 qwerty_UDT);

Are you using 8.0?  I don't think earlier versions allowed this.

> my prob is that when i try to insert into the type i.e: INSERT INTO t (col1) Values (qwerty_UDT(123));
> 
> i get the error:
> 
> ERROR:  function test_x(integer) does not exist

This error doesn't agree with the INSERT statement you gave -- it
should say "function qwerty_udt(integer) does not exist".  Where
does test_x() come from?  Did you type the SQL statements and/or
error messages instead of cutting and pasting?  We can see what's
happening, but it's better to paste the exact statements and output
to avoid mistakes.

> HINT:  No function matches the given name and argument types. You may need to add explicit type casts.

See the "Composite Types" documentation -- it has a section entitled
"Composite Value Input":

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

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



view thread (8+ messages)  latest in thread

Message-ID: <20041201001711.GA87131@winnie.fuhr.org>
Permalink:  ../20041201001711.GA87131@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20041201001711.GA87131@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, andrew.thorley@linuxmail.org
  Subject: Re: inserting values into types
  In-Reply-To: <20041201001711.GA87131@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