On 07/25/2010 12:01 PM, Magnus Reftel wrote:
> create view myseq as select * from other_schema.foo_id_seq;
>
> but when I run "select nextval('myseq');" I get an error saying that
> myseq "is not a sequence". What other options are there?
It isn't clear (to me, at least) what you are trying to accomplish, but
does this do what you want?
create schema other_schema;
create SEQUENCE other_schema.foo_id_seq;
select current_schema;
current_schema
----------------
public
(1 row)
select nextval('other_schema.foo_id_seq');
nextval
---------
1
(1 row)
select nextval('other_schema.foo_id_seq');
nextval
---------
2
(1 row)
Joe
--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support