Matt,
> I'm attempting to convert a code which uses Oracle to Postgres.
>
> I am concerned about a couple of points in the SQL, which I should be
> able to do
> in Postgres.
>
> Say I have defined a sequence DataId;
>
> The Oracle uses the sequence as follows:
>
> insert into TABLE (id1,.......,id2)
> values (DataId.NextVal,......,DataId.Currval);
>
> I believe that I can replace this in Postgres with:
>
> insert into TABLE (id1,.......,id2)
> values (nextval('DataId'),.....,currval('DataId');
>
>
> What I think is expected is that the values of id1 and id2 will be
> equal.
This is correct. Please post if you for some reason find them not
equal.
-Josh Berkus