Re: Copy/Paste table(s) functions

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Vladimir Kokovic <vladimir(dot)kokovic(at)gmail(dot)com>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Copy/Paste table(s) functions
Date: 2011-04-17 13:50:43
Message-ID: 4DAAF033.8020605@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Le 14/04/2011 10:21, Vladimir Kokovic a écrit :
> Hi,
>
> During copy/paste testing I've found that on 9.1 'COLLATE' should be
> omitted from table constraints definitions..Look in my PostgreSQL log:
>
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG:
> statement: SELECT relname FROM pg_namespace n LEFT JOIN pg_class c ON
> n.oid=c.relnamespace AND relkind='r' WHERE nspname='"".""' AND
> relname='edi_razmena'
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG: duration: 7.734 ms
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG: statement: BEGIN
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG: duration: 2.135 ms
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG:
> statement: SHOW search_path
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG: duration: 1.804 ms
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 ERROR: syntax
> error at or near "COLLATE" at character 1232
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 STATEMENT: SET
> search_path=""".""";-- Table: edi_razmena
>
> -- DROP TABLE edi_razmena;
>
> CREATE TABLE edi_razmena
> (
> godina character varying COLLATE pg_catalog."default" NOT NULL,
> razmena_id character varying COLLATE pg_catalog."default" NOT NULL,
> char_set character varying COLLATE pg_catalog."default" NOT NULL,
> kupac character varying COLLATE pg_catalog."default" NOT NULL,
> dobavljac character varying COLLATE pg_catalog."default" NOT NULL,
> datum date NOT NULL,
> vreme time without time zone NOT NULL,
> test character varying COLLATE pg_catalog."default" NOT NULL,
> odgovor character varying COLLATE pg_catalog."default" NOT NULL,
> ts timestamp without time zone NOT NULL DEFAULT now(),
> CONSTRAINT edi_razmena_pkey PRIMARY KEY (godina COLLATE
> pg_catalog."default", razmena_id COLLATE pg_catalog."default", kupac
> COLLATE pg_catalog."default")
> )
> WITH (
> OIDS=FALSE
> );
> ALTER TABLE edi_razmena OWNER TO vlada;
> GRANT ALL ON TABLE edi_razmena TO vlada;
> GRANT ALL ON TABLE edi_razmena TO public;
>
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG: statement: ROLLBACK
> 2011-04-14 10:04:28 CEST asoft 127.0.0.1(41254) 5357 0 LOG: duration: 1.383 ms
>

I don't see how you can have that issue. When I add a primary key (to a
new table or to an existing table), I don't have a COLLATE clause.

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2011-04-17 14:02:32 pgAdmin III commit: Don't show collation if it's the default one
Previous Message Guillaume Lelarge 2011-04-17 13:44:10 pgAdmin III commit: Fix a crash when adding an index constraint