Re: function does not exist error...

From: Dan Jewett <danjewett(at)mac(dot)com>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: function does not exist error...
Date: 2002-11-21 22:18:17
Message-ID: p05200f05ba030b6ba3b9@[162.84.132.56]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

>Dan,
>
>> Can someone help me figure out why my trigger can't meet my function?
>> Other than the obvious reason that I'm a total beginner, and I don't
>> know what the heck I'm doing. :-)
>
>Welcome to the NOVICE list, then.
>
>>
>> After I got the CreateTrigger error, I reran the CreateFunction query
>> just to see what would happen:
>>
>> recordings=> CREATE FUNCTION check_participant(varchar) RETURNS
>> opaque AS '
>
>Here's your problem; you've created a function with a varchar parameter
>...
>
>> ERROR: CreateTrigger: function check_participant() does not exist
>
>... and you're then calling it with no parameters. check_participant()
>and check_participant('some string') are two different functions, as
>would be check_participant(Numeric, Int) if you created it.
>
>However, the function you have is otherwise inappropriate; it returns
>values to the screen (not possible with a trigger), takes a parameter,
>and does not return NEW. What are you trying to do, exactly?
>
>-Josh Berkus

Josh, Thanks for your response.

The big picture of what I'm trying to do is that I have large flat
file of records created with info about individual recordings
(songs). I want to split those out into appropriately referenced
tables.

I thought I could create a combination of rules and triggers to step
through the table (or a text file exported from it) and send the data
where it needs to go. Part of the process would be to check for
existing entries to prevent redundency. I also want be able to add
entries to join tables on the fly.

I'm obviously not getting some of the basics of this process, and
having trouble with syntax. So it looks like I'm going to have to
back up a bit.

Thanks for the info on the functions,
Dan

If you are remotely interested...
Below is the draft of the table set I want to work with. It makes
sense if a "performance" record is understood as an instance of a
participant on a recording, and if "track" is understood as an
instance of a recording on an album.

BEGIN;

CREATE TABLE album
(
album_id SERIAL PRIMARY KEY,
catalog_id VARCHAR,
title VARCHAR,
media VARCHAR,
release_date VARCHAR,
notes TEXT
);

SELECT setval('album_album_id_seq', 1000);

CREATE TABLE recording
(
recording_id SERIAL PRIMARY KEY,
title VARCHAR,
date VARCHAR,
genre VARCHAR,
path VARCHAR,
notes TEXT
);

SELECT setval('recording_recording_id_seq', 1000);

CREATE TABLE track --join table on recording-album
(
track_id SERIAL PRIMARY KEY,
recording_id INT REFERENCES recording,
album_id INT REFERENCES album,
track_no INT,
track_length INTERVAL
);

SELECT setval('track_track_id_seq', 1000);

CREATE TABLE participant
(
participant_id SERIAL PRIMARY KEY,
fname VARCHAR,
lname VARCHAR,
mname VARCHAR,
nick VARCHAR,
birth DATE,
death DATE,
blocation VARCHAR,
dlocation VARCHAR,
notes TEXT
);

SELECT setval('participant_personal_id_seq', 1000);

CREATE TABLE performance --join table on recording-participant
(
performance_id SERIAL PRIMARY KEY,
recording_id INT REFERENCES recording,
participant_id INT REFERENCES participant,
role VARCHAR
);

SELECT setval('performance_performance_id_seq', 1000);

COMMIT;

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2002-11-21 23:36:32 Re: function does not exist error...
Previous Message Josh Berkus 2002-11-21 21:33:16 Re: function does not exist error...