From: Ian B. <ia...@co...> - 2004-12-06 22:31:56
|
Oleg Broytmann wrote: > 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. I was just saying I don't know the original intention of the comment. >>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? pg_class and pg_catalog.pg_class seem to be the same thing in PG 7.4. Actually, maybe all pg_catalog schema references are unnecessary in PG 7.4? I wonder if that's a transitional thing, e.g., in PG 8.0 you'll have to use the schema name, but until then it's optional? -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |