Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYPlo-0006Xn-22 for pgsql-bugs@postgresql.org; Tue, 13 Nov 2012 23:19:52 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYPlm-0007GQ-0Y for pgsql-bugs@postgresql.org; Tue, 13 Nov 2012 23:19:51 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.80) (envelope-from ) id 1TYPlk-0003VC-6p; Wed, 14 Nov 2012 00:19:48 +0100 Date: Wed, 14 Nov 2012 00:19:48 +0100 From: hubert depesz lubaczewski To: Matt@rigminder.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7657: Create Table doesn't create columns Message-ID: <20121113231947.GA7849@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201211/66 X-Sequence-Number: 34624 On Tue, Nov 13, 2012 at 04:59:53PM +0000, Matt@rigminder.com wrote: > The following bug has been logged on the website: > > Bug reference: 7657 > Logged by: Matt > Email address: Matt@rigminder.com > PostgreSQL version: 9.1.4 > Operating system: Windows Server Standard SP2 > Description: > > When I run the following statement, the table is created, but there are no > columns: > > CREATE TABLE "mod_1237" ("Collecteddepth" float8 NOT NULL, "Collectedtime" > float8 NOT NULL, "CollectedData" Varchar(45) NOT NULL, "Collectedpass" > float8 NOT NULL, "Collectedmodtime" float8 NOT NULL) WITH (OIDS = FALSE); > > I know I'm not creating a primary key, but that shouldn't prevent the > columns from being generated. When I run this code it also doesn't generate > any errors so everything looks fine until I try to write to the table. Any > ideas as to why this wouldn't work or how to make a table with the given > columns? most likely you did insert like: insert into mod_1237 (Collecteddepth) values (...) i.e. you didn't quote the column names. Hence the problem. In psql, you can do: \d mod_1237 and you will see the columns are there. Best regards, depesz -- The best thing about modern society is how easy it is to avoid contact with it. http://depesz.com/