base and postgres

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

base and postgres

Bernhard Rohrer
Hi guys

I have created a very simple database in postgres and tried to write
data into it. I got the following error message:

Error code: 1

pq_driver: [PGRES_FATAL_ERROR]ERROR:  array value must start with "{" or
dimension information
LINE 1: ...O "public"."Bladetypes" ( "ID","type") VALUES ( '1','Knife')
                                                                ^
  (caused by statement 'INSERT INTO "public"."Bladetypes" ( "ID","type")
VALUES ( '1','Knife')')

the table looks like this:

CREATE TABLE "Bladetypes"
(
   "ID" integer NOT NULL,
   "type" character varying[] NOT NULL,
   CONSTRAINT "Bladetypes_pkey" PRIMARY KEY ("ID")
)

ALTER TABLE "Bladetypes" ADD COLUMN "ID" integer;
ALTER TABLE "Bladetypes" ALTER COLUMN "ID" SET NOT NULL;

ALTER TABLE "Bladetypes" ADD COLUMN "type" character varying[];
ALTER TABLE "Bladetypes" ALTER COLUMN "type" SET NOT NULL;

any ideas?

Thanks

Bernhard

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: base and postgres

Josh Berkus
                                                               ^

>  (caused by statement 'INSERT INTO "public"."Bladetypes" ( "ID","type")
> VALUES ( '1','Knife')')
>
> the table looks like this:
>
> CREATE TABLE "Bladetypes"
> (
>   "ID" integer NOT NULL,
>   "type" character varying[] NOT NULL,
>   CONSTRAINT "Bladetypes_pkey" PRIMARY KEY ("ID")
> )

You created type as an Array of Varchar.  Was that intentional?


--
                                  -- Josh Berkus
                                     PostgreSQL Experts Inc.
                                     http://www.pgexperts.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: base and postgres

Bernhard Rohrer
On 07/01/11 18:14, Josh Berkus wrote:

>                                                                 ^
>>   (caused by statement 'INSERT INTO "public"."Bladetypes" ( "ID","type")
>> VALUES ( '1','Knife')')
>>
>> the table looks like this:
>>
>> CREATE TABLE "Bladetypes"
>> (
>>    "ID" integer NOT NULL,
>>    "type" character varying[] NOT NULL,
>>    CONSTRAINT "Bladetypes_pkey" PRIMARY KEY ("ID")
>> )
> You created type as an Array of Varchar.  Was that intentional?
>
>
nope. where does it say that? I created it using the driver, specifying
memo(_varchar) as data type. what should i have done instead?

Thanks!

Bernhard

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: base and postgres

Josh Berkus

> nope. where does it say that? I created it using the driver, specifying
> memo(_varchar) as data type. what should i have done instead?

_varchar means "array of varchar".  Remove the _.

--
                                  -- Josh Berkus
                                     PostgreSQL Experts Inc.
                                     http://www.pgexperts.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: base and postgres

Bernhard Rohrer
On 07/01/11 18:32, Josh Berkus wrote:
>> nope. where does it say that? I created it using the driver, specifying
>> memo(_varchar) as data type. what should i have done instead?
> _varchar means "array of varchar".  Remove the _.
>
thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]