Re: BUG #7657: Create Table doesn't create columns

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Matt(at)rigminder(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7657: Create Table doesn't create columns
Date: 2012-11-13 23:19:48
Message-ID: 20121113231947.GA7849@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Nov 13, 2012 at 04:59:53PM +0000, Matt(at)rigminder(dot)com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 7657
> Logged by: Matt
> Email address: Matt(at)rigminder(dot)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/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message zoulx1982 2012-11-14 07:26:08 BUG #7658: the result of pg_get_viewdef can NOT execute directly
Previous Message Andrew Dunstan 2012-11-13 17:35:03 Re: [HACKERS] BUG #7656: PL/Perl SPI_freetuptable() segfault