pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedbroken restore.sql script !?
4+ messages / 2 participants
[nested] [flat]
* broken restore.sql script !?
@ 2006-02-22 16:45 Christian Sengstock <csengstock@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Christian Sengstock @ 2006-02-22 16:45 UTC (permalink / raw)
To: pgsql-admin
hi list,
i have a auto-generated restore.sql script which doesn't work for me because
of an obvious error inside of it. because the script is working for other
people i thought of an os error (i use linux, others windows).
the problem:
The function is created outside of the 'geo' schema, but after that, the
'alter function' statement tries to alter the function inside of the 'geo'
schema. the restore.sql file is from pgadmin. maybe there's a statement so
that the function could be created inside of the geo schema without writing
it explicit. like '\set search_path', so that i can restore it on the linux
command line.
some lines of it: ...
------------------------------------------------------------------------------------------------------
--
-- Name: box2d_out(box2d); Type: FUNCTION; Schema: geo; Owner: postgres
--
CREATE FUNCTION box2d_out(box2d) RETURNS cstring
AS '$libdir/liblwgeom.so', 'BOX2DFLOAT4_out'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION geo.box2d_out(box2d) OWNER TO postgres;
--
-- Name: box2d; Type: TYPE; Schema: geo; Owner: postgres
--
CREATE TYPE box2d (
INTERNALLENGTH = 16,
INPUT = box2d_in,
OUTPUT = box2d_out,
ALIGNMENT = int4,
STORAGE = plain
);
ALTER TYPE geo.box2d OWNER TO postgres;
-----------------------------------------------------------------------------------------------------------------------
thankx,
chris
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: broken restore.sql script !?
@ 2006-02-22 17:00 Tom Lane <tgl@sss.pgh.pa.us>
parent: Christian Sengstock <csengstock@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2006-02-22 17:00 UTC (permalink / raw)
To: Christian Sengstock <csengstock@gmail.com>; +Cc: pgsql-admin
"Christian Sengstock" <csengstock@gmail.com> writes:
> The function is created outside of the 'geo' schema, but after that, the
> 'alter function' statement tries to alter the function inside of the 'geo'
> schema.
This is pg_dump's normal method of operation. There should have been a
"SET search_path = geo, pg_catalog;" command somewhere before the
excerpt you gave. I think you probably broke the script by carelessly
extracting a part of it...
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: broken restore.sql script !?
@ 2006-02-22 18:03 Christian Sengstock <csengstock@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Christian Sengstock @ 2006-02-22 18:03 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
hi again,
2006/2/22, Tom Lane <tgl@sss.pgh.pa.us>:
>
> "Christian Sengstock" <csengstock@gmail.com> writes:
> > The function is created outside of the 'geo' schema, but after that, the
> > 'alter function' statement tries to alter the function inside of the
> 'geo'
> > schema.
This is pg_dump's normal method of operation. There should have been a
> "SET search_path = geo, pg_catalog;" command somewhere before the
> excerpt you gave.
does that mean a prior "SET search_path = geo, pg_catalog;" would create the
function inside of the geo schema ? i have this setting but it's not working
for me, despite the function is in the public schema.
i use /> psql -d mydb -U user -f restore.sql
to restore it. Could the behaviour be different when using 'pg_restore' ?
thanx,
chris
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: broken restore.sql script !?
@ 2006-02-22 18:59 Tom Lane <tgl@sss.pgh.pa.us>
parent: Christian Sengstock <csengstock@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2006-02-22 18:59 UTC (permalink / raw)
To: Christian Sengstock <csengstock@gmail.com>; +Cc: pgsql-admin
"Christian Sengstock" <csengstock@gmail.com> writes:
> does that mean a prior "SET search_path =3D geo, pg_catalog;" would create =
> the
> function inside of the geo schema ? i have this setting but it's not workin=
> g
> for me, despite the function is in the public schema.
> i use /> psql -d mydb -U user -f restore.sql
> to restore it. Could the behaviour be different when using 'pg_restore' ?
Shouldn't be different. Can you provide a test case?
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2006-02-22 18:59 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-22 16:45 broken restore.sql script !? Christian Sengstock <csengstock@gmail.com>
2006-02-22 17:00 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-02-22 18:03 ` Christian Sengstock <csengstock@gmail.com>
2006-02-22 18:59 ` Tom Lane <tgl@sss.pgh.pa.us>
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