Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report problem

Status
Not open for further replies.

totti24

Programmer
Aug 2, 2002
32
0
0
MY
hi all, i'm trying to build a report using excel's pivot table function. and the db i'm using is postgresql 7.3.1.

i got a problem retriving data from the db bcoz i got this error mesg "No such attribute item.oid". if i retrieve directly from a table in postgresql, it doesn't give me this error. but if i retrieve from a view, it gave me that problem. as i know, oid is an id that exist in every table probably hidden. waht about view? if i create a view, i doesn't consist any oid? please advice
 
I'm not sure of all the potential reasons why this could occur, but here are some possible solutions:

1. You can create tables without any OIDs, just by specifying
Code:
WITHOUT OIDS;
after the table definition:

Code:
CREATE TABLE foo (
bar SERIAL NOT NULL,
etc VARCHAR(100)
) WITHOUT OIDS;

2. You might want to get the updated ODBC driver for PostgreSQL that just came out, which handles ODBC3.

3. If you set the right log level in postgresql.conf, every incoming query will be saved in the log, so you can possibly get an idea of what Excel is trying to do and how to fix it. It might just be a simple naming incompatibility, or something to do with quotes or special characters.

-------------------------------------------

My PostgreSQL FAQ --
 

but all my tables are created with OIDs. how can i change it to WITHOUT OIDs. coz as far as i'm concern, the alter command doesn't allow that. plz advice.
 
No, but it is very easy to do a pg_dump of your tables, drop your database, add WITHOUT OIDS to the table definitions in the dump, and then pipe the dump back in to re-create your database.

Anyway, why don't you try the other two choices first? Without knowing what Excel is trying to do with the pivot function, it is impossible to give you any more advice.

-------------------------------------------

My PostgreSQL FAQ --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top