Search Postgresql Archives

Re: varchar(n) VS text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Glaesemann wrote:
Works for me:

test=# select version();
                                                                   version
---------------------------------------------------------------------------------------------------------------------------------------------- PostgreSQL 8.2.4 on powerpc-apple-darwin8.9.0, compiled by GCC powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
(1 row)

test=# create table tester (test_varchar varchar primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tester_pkey" for table "tester"
CREATE TABLE
test=# insert into tester (test_varchar) values ('abc''test');
INSERT 0 1
test=# select * from tester;
test_varchar
--------------
abc'test
(1 row)

Michael Glaesemann
grzm seespotcode net

Looks like my bad - I created the table initially through pgAdminIII and it appears I selected the wrong character varying from the dropdown list.

CREATE TABLE tester
(
  test_varchar character varying[],
  test_text text
)

If I change it to character varying(20) it works fine.

Apologies for that.

Thanks for the other info though.

--
Paul Lambert
Database Administrator
AutoLedgers


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux