pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthew Kuss <matt@rigminder.com>
To: depesz@depesz.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7657: Create Table doesn't create columns
Date: Wed, 14 Nov 2012 10:00:08 -0600
Message-ID: <000f01cdc281$1ef20680$5cd61380$@rigminder.com> (raw)
In-Reply-To: <20121113231947.GA7849@depesz.com>
References: <E1TYJq5-00038e-4s@wrigleys.postgresql.org>
	<20121113231947.GA7849@depesz.com>

Depesz -

I'm fairly sure it's not a problem with something I'm doing wrong because I've used the same code before. It has to be something wrong on the DB side. But just to entertain you I did as you requested:

RigMinder_NewDBTest02=# \d test
    Table "public.test"
 Column | Type | Modifiers
--------+------+-----------


RigMinder_NewDBTest02=#

Before I ran this I created a table using the following:

create table "test" ("column1" text, "column2" float);

It ran without any errors. Yesterday after I sent out the help request I uninstalled postgresql and installed version 9.0.10 and I'm having the same problem. It does look like it only occurs when my logging package is running. Ie if I shut it down, I can create tables in pgAdmin, but as soon as my program is running, I get the errors described above. Any other ideas on how to fix this? 

Thanks for all the help!
Matt

-----Original Message-----
From: depesz@depesz.com [mailto:depesz@depesz.com] 
Sent: Tuesday, November 13, 2012 5:20 PM
To: Matt@rigminder.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #7657: Create Table doesn't create columns

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/





view thread (6+ messages)  latest in thread

Message-ID: <000f01cdc281$1ef20680$5cd61380$@rigminder.com>
Permalink:  ../000f01cdc281$1ef20680$5cd61380$@rigminder.com/
Also on:    postgresql.org/message-id/000f01cdc281$1ef20680$5cd61380$@rigminder.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: matt@rigminder.com, depesz@depesz.com
  Subject: Re: BUG #7657: Create Table doesn't create columns
  In-Reply-To: <000f01cdc281$1ef20680$5cd61380$@rigminder.com>
  References: <E1TYJq5-00038e-4s@wrigleys.postgresql.org> <20121113231947.GA7849@depesz.com> <000f01cdc281$1ef20680$5cd61380$@rigminder.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox