Thread: Re: Had to drop some table columns, managed to annoy MS
Is there a way to copy/export the DB (or it's tables) to another DB and dump all this stuff that's causing the problems? In particular, in the past I have exported the entirety of a database into a flat file and imported it into a "clean" version. Admittedly, it's been a while and that was for an app using DB2 which didn't have a lot of built in tools, but the theory applies... B/c building an ODBC driver is WAYYYY beyond 1)my skills and 2)the project timescale on this. I need to have this particular issue fixed tomorrow morning; if rebuilding the DB is the quickest way, I will do that, but I was hoping for a quicker (and less destructive) work around... Cheryl -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Cheryl Thompson <cthompso@ci.irving.tx.us> writes: > All my installs and drivers are the newest official releases that were > available as of Dec 29, 2002. (IE 2 weeks ago)... I looked at the psqlodbc CVS logs, and this was claimed to be fixed on 6 Dec --- but apparently there hasn't been a release put out since 29 Nov. I'd suggest pestering the ODBC guys for a new release (pgsql-odbc mailing list is probably a good place). Or pull the CVS-tip sources and build it yourself. -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Cheryl Thompson <cthompso@ci.irving.tx.us> writes: > I'm getting the following: > '..............pg.dropped.8........................' is not a valid name. Are you using an up-to-date ODBC driver? It looks like the one you have is not aware of the attisdropped column in pg_attribute ...
I use pgadmin II to access postgresql and they have a sweet little plugin called the Database Migration Wizard which lets you export access tables as well as a variety of others. It uses the odbc driver so I don't know if it will work around your problem but it might be a try. Either way, I find pgAdmin II makes my life a lot simpler when it comes to working with postgresql. Julie ----- Original Message ----- From: "Cheryl Thompson" <cthompso@ci.irving.tx.us> > Is there a way to copy/export the DB (or it's tables) to another DB and dump > all this stuff that's causing the problems? In particular, in the past I > have exported the entirety of a database into a flat file and imported it > into a "clean" version.
Cheryl, > Is there a way to copy/export the DB (or it's tables) to another DB and dump > all this stuff that's causing the problems? In particular, in the past I > have exported the entirety of a database into a flat file and imported it > into a "clean" version. Admittedly, it's been a while and that was for an > app using DB2 which didn't have a lot of built in tools, but the theory > applies... Sure. Use pg_dump. See the docs under "Server Programs" or your favorite PostgreSQL book. -- -Josh Berkus Aglio Database Solutions San Francisco
Use the pg_dump command: $ pg_dump DBNAME > FILENAME.sql pg_dump takes the same parameters as psql, so if you have to connect to an external db then you can specify it in a similar fashion to pg_dump. i hope this helps. good luck, - lex On Mon, 2003-01-13 at 18:04, Cheryl Thompson wrote: > Is there a way to copy/export the DB (or it's tables) to another DB and dump > all this stuff that's causing the problems? In particular, in the past I > have exported the entirety of a database into a flat file and imported it > into a "clean" version. Admittedly, it's been a while and that was for an > app using DB2 which didn't have a lot of built in tools, but the theory > applies... > > B/c building an ODBC driver is WAYYYY beyond 1)my skills and 2)the project > timescale on this. I need to have this particular issue fixed tomorrow > morning; if rebuilding the DB is the quickest way, I will do that, but I was > hoping for a quicker (and less destructive) work around... > > Cheryl > > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > > Cheryl Thompson <cthompso@ci.irving.tx.us> writes: > > All my installs and drivers are the newest official releases that were > > available as of Dec 29, 2002. (IE 2 weeks ago)... > > I looked at the psqlodbc CVS logs, and this was claimed to be fixed on 6 > Dec --- but apparently there hasn't been a release put out since 29 Nov. > I'd suggest pestering the ODBC guys for a new release (pgsql-odbc > mailing list is probably a good place). Or pull the CVS-tip sources and > build it yourself. > > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > > Cheryl Thompson <cthompso@ci.irving.tx.us> writes: > > I'm getting the following: > > '..............pg.dropped.8........................' is not a valid name. > > Are you using an up-to-date ODBC driver? It looks like the one you have > is not aware of the attisdropped column in pg_attribute ... > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
I'm at a total loss! My application was running fine and I didn't change anything and my coworker claims he didn't change anything then I started getting the following error. I looked through the archives for a similar problem and found that either a.) I didn't understand what caused the problem or the solution or b.) My scenario is different than the one mentioned in the archives. I am running Postgresql 7.2 in a cygwin environment on an NT machine. I don't want to spend a lot of time troubleshooting if it is a Windows problem since we are in the process of setting up a Linux machine to handle Postgresql and PHP. Let me know if you need more info to help identify the problem. Thanks in advance for any help you can provide. Julie /*Error message on page*/ Warning: PostgreSQL query failed: pqReadData() -- read() failed: errno=0 No error in c:\php\includes\db_pgsql.inc on line 69 Database error: Invalid SQL: select val from active_sessions where sid = '0e0460e75e2fc7783b9c991e14e3af9f' and name = 'Agtrac_Session' PostgreSQL Error: 1 (pqReadData() -- read() failed: errno=0 No error ) Session halted. /* snippet from db_pgsql.inc including line 69 (marked) below */ function query($Query_String) { /* No empty queries, please, since PHP4 chokes on them. */ if ($Query_String == "") /* The empty query string is passed on from the constructor, * when calling the class without a query, e.g. in situations * like these: '$db = new DB_Sql_Subclass;' */ return 0; $this->connect(); if ($this->Debug) printf("<br>Debug: query = %s<br>\n", $Query_String); /* line 69 */ $this->Query_ID = pg_Exec($this->Link_ID, $Query_String); $this->Row = 0; $this->Error = pg_ErrorMessage($this->Link_ID); $this->Errno = ($this->Error == "")?0:1; if (!$this->Query_ID) { $this->halt("Invalid SQL: ".$Query_String); } return $this->Query_ID; }