Thread: Some questions about oid's and sequences.
Howdy: I am coming from the Windows world, and Microsoft SQL variants in particular. Both Access and SQL Server have autoincrement data types -- I understand that Postgresql has "sequences" which do the same thing, but I can't find any documentation on them. I have browsed all the online documentation that comes with Postgresql, and can't find anything about it. Could someone point me to some docs that would explain how to use sequences? I have a similar question about oid's. I am not sure what they are -- from their name, I would guess that they are autoassigned, unique identifiers for each row in a table. Is that correct? If so (or even if not), how do I create and use them. Any documentation that addresses oid usage specifically? I am confused because oid's seem to be to substitute for the BLOB data type which is available in other RDBMS's. If you post a reply to this, could you also cc: to enorvelle1@uswest.net. TKA for your assistance. -Erik Norvelle
Attachment
Hello Erik, mercoledì, 2 settembre 98, you wrote: EN> Howdy: EN> I am coming from the Windows world, and Microsoft SQL variants in EN> particular. Both Access and SQL Server have autoincrement data types -- EN> I understand that Postgresql has "sequences" which do the same thing, EN> but I can't find any documentation on them. I have browsed all the EN> online documentation that comes with Postgresql, and can't find anything EN> about it. Could someone point me to some docs that would explain how to EN> use sequences? if U have v6.4 then: CREATE TABLE tbl(fld SERIAL); if you have v6.3.2 then: CREATE SEQUENCE serial; CREATE TABLE distributors ( did DECIMAL(03) PRIMARY KEY DEFAULT NEXTVAL('serial') ); EN> I have a similar question about oid's. I am not sure what they are -- EN> from their name, I would guess that they are autoassigned, unique EN> identifiers for each row in a table. Is that correct? Yes. OIDs are uniq to the whole database not only for tables. EN> If so (or even EN> if not), how do I create and use them. Any documentation that addresses EN> oid usage specifically? I am confused because oid's seem to be to EN> substitute for the BLOB data type which is available in other RDBMS's. EN> If you post a reply to this, could you also cc: to EN> enorvelle1@uswest.net. TKA for your assistance. EN> -Erik Norvelle Best regards, Jose' mailto:sferac@bo.nettuno.it
> Howdy: > > I am coming from the Windows world, and Microsoft SQL variants in > particular. Both Access and SQL Server have autoincrement data types -- > I understand that Postgresql has "sequences" which do the same thing, > but I can't find any documentation on them. I have browsed all the > online documentation that comes with Postgresql, and can't find anything > about it. Could someone point me to some docs that would explain how to > use sequences? > man create_sequence > I have a similar question about oid's. I am not sure what they are -- > from their name, I would guess that they are autoassigned, unique > identifiers for each row in a table. Yes. oid stands for Object I.D. Remember postgress is documented in an object oriented way. The tables definitions is called the "class" from which the "objects" (records) are instantiated. > Is that correct? If so (or even > if not), how do I create and use them. They are created automatically. To access them type: select oid from blah; > Any documentation that addresses > oid usage specifically? don't know. I kind of picked up the info from the list. > I am confused because oid's seem to be to > substitute for the BLOB data type which is available in other RDBMS's. No they are not even close to the same thing. Hope this helps...james