my schema + sql function

Started by Wr�belabout 23 years ago2 messagesbugs
Jump to latest
#1Wr�bel
netim@icentrum.pl

Hi,

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

Marek Wr�bel

From pgsql-bugs-owner@postgresql.org Tue Feb 18 13:56:02 2003

X-Original-To: pgsql-bugs@postgresql.org
Received: from localhost (postgresql.org [64.49.215.8])
by postgresql.org (Postfix) with ESMTP id C96B347580B
for <pgsql-bugs@postgresql.org>; Tue, 18 Feb 2003 13:56:01 -0500 (EST)
Received: from mail.gmx.net (mail.gmx.net [213.165.65.60])
by postgresql.org (Postfix) with SMTP id EC12B475458
for <pgsql-bugs@postgresql.org>; Tue, 18 Feb 2003 13:56:00 -0500 (EST)
Received: (qmail 5899 invoked by uid 0); 18 Feb 2003 18:55:59 -0000
Received: from p3E990A98.dip0.t-ipconnect.de (62.153.10.152)
by mail.gmx.net (mp002-rz3) with SMTP; 18 Feb 2003 18:55:59 -0000
Date: Tue, 18 Feb 2003 20:06:11 +0100 (CET)
From: Peter Eisentraut <peter_e@gmx.net>
X-X-Sender: peter@peter.localdomain
To: Brian Catlin <BrianC@sannas.org>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Windows binaries for 7.3.2?
In-Reply-To: <001b01c2d625$f66cba90$c301a8c0@tyrannosaurus>
Message-ID: <Pine.LNX.4.44.0302182005540.1644-100000@peter.localdomain>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: by AMaViS new-20020517
X-Archive-Number: 200302/84
X-Sequence-Number: 5500

Brian Catlin writes:

The Windows binaries for 7.3.2 are not on the FTP site. Where can I get
them?

http://www.cygwin.com

--
Peter Eisentraut peter_e@gmx.net

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Wr�bel (#1)
Re: my schema + sql function

Marek "Wr�bel" <netim@icentrum.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