From: Oleg B. <ph...@ma...> - 2004-12-06 22:21:32
|
On Mon, Dec 06, 2004 at 04:12:04PM -0600, Ian Bicking wrote: > Oleg Broytmann wrote: > >What is so obviously broken here? Looks pretty good for me. > > > > def tableExists(self, tableName): > > # @@: obviously broken > > result = self.queryOne("SELECT COUNT(relname) FROM pg_class WHERE > > relname = '%s'" > > % tableName) > > return result[0] > > I don't think I put that comment in there; I didn't originally write the > Postgres code. I didn't blame anyone :), I just asked - my be I've overlooked something important. > The "'%s'" % tableName is bad, though. That's easy to fix, and I'll fix it. What is more interesting - what does correspond to pg_class in Postgres >= 7.3? Still pg_class? or something in pg_catalog? Does anybody know newer postgres catalogs? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |