Re: my schema + sql function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marek " Wr bel "" <netim(at)icentrum(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: my schema + sql function
Date: 2003-02-19 14:57:50
Message-ID: 11135.1045666670@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Marek "Wrbel" <netim(at)icentrum(dot)pl> writes:
> In my schema : "my" I create sql function

> CREATE OR REPLACE FUNCTION my.my_foo(int4) RETURNS varchar AS '
> select k.k_dupa ||coalesce( '' ['' || k.k_number || '']'' ,'''')
> from kont k
> where k_id = $1;
> ' LANGUAGE 'sql';

> table kont is in schema public.

> Everythink working ok, but when I try to restore backup system write :

> pg_restore: [archiver (db)] could not execute query: ERROR: Relation "kont" does not exist
> pg_restore: *** aborted because of error

Probably table "kont" didn't exist when you first created that function?
pg_dump isn't very smart about rearranging the order of object creation
to handle such dependencies. You'll need to manually adjust the dump
order to deal with this. There are options to pg_restore that you can
use to change the order in which it reload objects.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Childs 2003-02-19 15:33:14 Trigger Crashes Database Back End.
Previous Message pgsql-bugs 2003-02-19 11:06:35 Bug #899: pg_dumpall produce erroneous files if the databbase use procedural language.