Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'mrab': 0.05; 'postgresql': 0.07; 'works.': 0.07; '22,': 0.09; 'etc).': 0.09; 'commit': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'suggested,': 0.16; 'surprising': 0.16; 'visible;': 0.16; 'wrote:': 0.17; 'feb': 0.19; 'module': 0.19; 'changes': 0.20; '(by': 0.22; 'visible': 0.22; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'guess': 0.27; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; '>>>>': 0.29; 'things,': 0.29; 'probably': 0.29; 'fri,': 0.30; 'unlike': 0.30; 'primary': 0.30; 'help,': 0.32; 'certain': 0.33; 'anyone': 0.33; 'to:addr:python- list': 0.33; 'front': 0.33; 'received:google.com': 0.34; 'table': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'next': 0.35; 'but': 0.36; 'does': 0.37; 'being': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'help': 0.40; 'helping': 0.63; 'become': 0.65; 'serial': 0.66; 'integrity': 0.75; '(id': 0.84; '2013': 0.84; 'forced': 0.84; 'engines,': 0.93; 'silent': 0.95; 'incredibly': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=TXC7796VccPIHNB/YN2AkxR/Ebc8L0wmwYbSKcemb2g=; b=cbLA7MWFSbETTtDA5rGUvy/kX4snoO7fTLiolvaEUveT5rty5DwBXfYUplRzQAsk88 SQGyqCdAKyirIbcNMNlI3vMwrn5l5HYk/PKf588ZQwqsPKosevQzolpsftuiqtGny94O /o2wseCId6NJt+NElQTTmejTyBPcqjiqv830ek0EH1sCggRHtTwVL5Za2i8IhOSuwbZa gaQDWLN0pPS5qM2yWZ6qQRNVc2M8tEzpV8BTBLkr7x0LvIFtEHM+KfxAHfIkOzwM2AEc 1JFeGjC0QbLnbCo+98+3SkvvxMURzldXKRe6embWUAppIR+OeQF6azerQcH1vT2Za4z/ egYg== MIME-Version: 1.0 X-Received: by 10.58.97.165 with SMTP id eb5mr1040586veb.40.1361514156962; Thu, 21 Feb 2013 22:22:36 -0800 (PST) In-Reply-To: <2427e351-dd19-4e13-af76-d1c41aa5ad3d@googlegroups.com> References: <2427e351-dd19-4e13-af76-d1c41aa5ad3d@googlegroups.com> Date: Fri, 22 Feb 2013 17:22:36 +1100 Subject: Re: psycopg2 craziness From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361514159 news.xs4all.nl 6957 [2001:888:2000:d::a6]:43043 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39524 On Fri, Feb 22, 2013 at 10:27 AM, wrote: >>>> cursor_to.execute("CREATE TABLE foo (id serial PRIMARY KEY);") Like many things, it's silent when everything works. As MRAB suggested, you probably need to commit before the changes become visible; unlike certain other database engines, PostgreSQL actually provides transactional integrity for DDL queries (CREATE/DROP TABLE etc) as well as DML queries (INSERT/UPDATE etc). This is incredibly handy, but can be surprising if you're accustomed to them being immediately visible to other sessions. But next time you ask for help, don't say that you're "having issues" - say *what* issues you're having! It makes helping you so much easier if we know up front what you need help with, rather than being forced to guess :) (By the way, does anyone else see irony in there being "craziness" in a module that's pretty much called "psycho"?) ChrisA