BUG #1530: search on uuid indexed article returns no resultat

Поиск
Список
Период
Сортировка
Искать

BUG #1530: search on uuid indexed article returns no resultat

От:
"Avram" <bogdan.avram@ulpmm.u-strasbg.fr>
Дата:
The following bug has been logged online:

Bug reference:      1530
Logged by:          Avram
Email address:      bogdan.avram@ulpmm.u-strasbg.fr
PostgreSQL version: 7.4.6 testing
Operating system:   Debian kernel 2.4.18 testing (pg-uuid 0.01)
Description:        search on uuid indexed article returns no resultat
Details: 

The SELECT command using a 'uuid' field indexed with pk_situation returns no
result. The error dissapear after the backup and the restore of the database
or after deleting the index.


--
-- PostgreSQL database dump
--

SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- TOC entry 2211 (class 0 OID 0)
-- Name: DUMP TIMESTAMP; Type: DUMP TIMESTAMP; Schema: -; Owner: 
--

-- Started on 2005-03-08 09:57:21 Paris, Madrid


SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = true;

--
-- TOC entry 1967 (class 1259 OID 43638)
-- Dependencies: 2206 2 903 903
-- Name: situation; Type: TABLE; Schema: public; Owner: postgres;
Tablespace: 
--

CREATE TABLE situation (
    id uuid DEFAULT newid() NOT NULL,
    nom character varying(100) NOT NULL,
    description text,
    texteexpositif text NOT NULL,
    resultatattendu text NOT NULL,
    bibliographie text,
    datecreation timestamp without time zone NOT NULL,
    idseminaire uuid NOT NULL
);


ALTER TABLE public.situation OWNER TO postgres;

--
-- TOC entry 2210 (class 0 OID 43638)
-- Dependencies: 1967
-- Data for Name: situation; Type: TABLE DATA; Schema: public; Owner:
postgres
--

COPY situation (id, nom, description, texteexpositif, resultatattendu,
bibliographie, datecreation, idseminaire) FROM stdin;
47aa019e-8040-11d9-98e1-00e0180dcd8e	sdds	dsdsds	ds	dsds	dsdss	2005-02-16
17:29:15.27033	05a7c92a-4dbe-11d9-825d-00e0180dcd8e
f30351de-80b9-11d9-9d32-00e0180dcd8e	dssdsdd	fsdds	fdsfd	dsfsdf	dsfdsf	2005-
02-17 08:00:11.821739	05a7c92a-4dbe-11d9-825d-00e0180dcd8e
1a3f3eaa-80e4-11d9-9899-00e0180dcd8e	sdf	dsfdfs	sdf	sdf	dfsdfs	2005-02-17
13:01:56.537195	23693990-803f-11d9-8135-00e0180dcd8e
19105950-81d5-11d9-8d4b-00e0180dcd8e	dsf	sdfdsf	dsf	dsf	dsf	2005-02-18
18:47:03.25149	23693990-803f-11d9-8135-00e0180dcd8e
1f97042c-81d5-11d9-8d4b-00e0180dcd8e	fsd	sdfsdf	dfsfsd	sdffsd	dsffdsfds	2005
-02-18 18:47:14.214234	23693990-803f-11d9-8135-00e0180dcd8e
a6e6e062-8042-11d9-9818-00e0180dcd8e	dsf	dsfsdf	dsf	dfs	dsfdsf	2005-02-16
17:46:14.04676	23693990-803f-11d9-8135-00e0180dcd8e
f37e7418-8041-11d9-9f4e-00e0180dcd8e	dsf	dsf dsf	sdf sdf	sdf \r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

\r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

sdf \r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

\r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

\r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

\r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

\r\n

public DataSet ListeSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return PostgreSqlHelper.ExecuteDataset(this._ChaineConnexion,

\r\n

"Situation_ListeSituationSeminaire(:a) as (Id uuid, DateCreation timestamp, IdSeminaire uuid)",

\r\n

new NpgsqlParameter[] {new NpgsqlParameter("a", IdSeminaire)});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

public int NombreSituationSeminaire(Guid IdSeminaire)

\r\n

{

\r\n

try

\r\n

{

\r\n

return (int) PostgreSqlHelper.ExecuteScalar(

\r\n

this._ChaineConnexion,

\r\n

"Situation_NombreSituationSeminaire(:a)" ,

\r\n

new NpgsqlParameter[] {

\r\n

new NpgsqlParameter("a", IdSeminaire)

\r\n

});

\r\n

}

\r\n

catch (NpgsqlException ExceptionSql)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurSql, ExceptionSql);

\r\n

}

\r\n

catch (InvalidOperationException ExceptionOperationInvalide)

\r\n

{

\r\n

throw new ApplicationException(_MessageErreurOperationInvalide,

\r\n

ExceptionOpe rationInvalide);

\r\n

}

\r\n

}

\r\n

#endregion

Méthodes

2005-02-16 17:41:13.050158 05a7c92a-4dbe-11d9-825d-00e0180dcd8e \. -- -- TOC entry 2208 (class 16386 OID 43645) -- Dependencies: 1967 1967 -- Name: pk_situation; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: -- ALTER TABLE ONLY situation ADD CONSTRAINT pk_situation PRIMARY KEY (id); ALTER INDEX public.pk_situation OWNER TO postgres; -- -- TOC entry 2209 (class 16386 OID 43646) -- Dependencies: 1967 1940 -- Name: fk_situation_seminaire_idseminaire; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY situation ADD CONSTRAINT fk_situation_seminaire_idseminaire FOREIGN KEY (idseminaire) REFERENCES seminaire(id) ON DELETE CASCADE; -- -- TOC entry 2215 (class 0 OID 0) -- Name: DUMP TIMESTAMP; Type: DUMP TIMESTAMP; Schema: -; Owner: -- -- Completed on 2005-03-08 09:57:21 Paris, Madrid -- -- TOC entry 2214 (class 0 OID 0) -- Dependencies: 1967 -- Name: situation; Type: ACL; Schema: public; Owner: postgres -- REVOKE ALL ON TABLE situation FROM PUBLIC; CREATE UNIQUE INDEX pk_situation ON situation USING btree (id); -- Operator Class: "uuid_ops" -- DROP OPERATOR CLASS uuid_ops USING btree; CREATE OPERATOR CLASS uuid_ops DEFAULT FOR TYPE uuid USING btree AS OPERATOR 1 <, OPERATOR 2 <=, OPERATOR 3 =, OPERATOR 4 >=, OPERATOR 5 >, FUNCTION 1 uuid_cmp(uuid, uuid);

Re: BUG #1530: search on uuid indexed article returns no resultat

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Avram"  writes:
> The SELECT command using a 'uuid' field indexed with pk_situation returns no
> result. The error dissapear after the backup and the restore of the database
> or after deleting the index.

There is no uuid datatype in the standard Postgres distribution.  I
suppose this is a bug in uuid's comparison routines; I suggest reporting
it to wherever you got the uuid datatype from.

			regards, tom lane
FAQ