osdir.com
mailing list archive
Mozy Online Backup: 2GB Free. Automatic. Secure.

Subject: Re: function does not exist error... - msg#00183

List: db.postgresql.novice

Date: Prev Next Index Thread: Prev Next Index
Dan,

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.

Why do you want to use Triggers and Rules? Do you need to import this data
from source daily? Even so, batch processing will be faster than executing a
trigger for each row inserted.

--
-Josh Berkus

You are right of course. Thanks for rearranging my thinking on this. So, on to figuring out the query for the batch.

Dan

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: How does "SELECT ... FOR UPDATE" work?

Joshua Daniel Franklin <joshua@xxxxxxxx> writes: > Obviously I'm missing something here. I think you forgot to issue a "BEGIN;" to open a transaction block. The lock created by FOR UPDATE (or any other lock) is only held till transaction commit. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

Next Message by Date: click to view message preview

(unknown)

Considering the function below, is it possible to get the value of the album_id from the first INSERT statement and use it in the 2nd INSERT statement as I have tried to do here? Or do has the sequence not update until the end of the LOOP? I have tried this and get: ERROR: Attribute 'album_album_id_seq' not found How would I accomplish this? CREATE FUNCTION catalog_batch() RETURNS text AS ' DECLARE myrec RECORD; BEGIN FOR myrec IN SELECT * FROM catalog LOOP INSERT INTO album (columns,....) VALUES ('matching values',....); INSERT INTO track (columns,....) VALUES ( currval(album_album_id_seq), 'other matching values',.... ); <rest of code> END LOOP; RETURN 'Batch Complete'; END; ' LANGUAGE 'plpgsql'; Thanks, Dan Jewett ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly

Previous Message by Thread: click to view message preview

Re: function does not exist error...

Dan, > 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. Why do you want to use Triggers and Rules? Do you need to import this data from source daily? Even so, batch processing will be faster than executing a trigger for each row inserted. -- -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@xxxxxxxxxxxx and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

Next Message by Thread: click to view message preview

Viewing Foreign key constraints in psql

Hi: How do I view the foreign key constraints (name and definition) in psql? I can only see the triggers created by the constraint when I use the "\d <table>" command in psql. Thank you , ludwig __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by