Re: [SQL] how to add primary key to existing table with multiple primary keys

2006-03-01 Thread Mauricio Fernandez A.
Your table has a primary key yet, so you can´t add a second primary key.  You only can define one pk, however it can be composed as your table has (it now has 2 columns), so I think you need to drop the current pk and add again the new pk with your 3 columns (probeid, tissueid, expid).   Rev

Re: [SQL] Slow update SQL

2006-03-01 Thread Mauricio Fernandez A.
 You can try this too:...WHERE EXTRACT(YEAR FROM dxdate::Date) > 2000 Mauricio Fernández A.Ingeniero de SistemasUniversidad Autónoma de Manizales (Colombia) -Mensaje original-De: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED]]En nombre de Bungsuputra LinanEnviado el: lunes, 27 febrero, 2

Re: [SQL] Unable to identify an ordering operator '<' for type 'smallint[]'

2006-01-11 Thread Mauricio Fernandez A.
I get the result expected Thanks for your help Mauricio Fernández A. Ingeniero de Sistemas U. Autónoma de Manizales -Mensaje original- De: Tom Lane [mailto:[EMAIL PROTECTED] Enviado el: miércoles, 11 enero, 2006 19:25 Para: Mauricio Fernandez A. CC: pgsql-sql@postgresql.org Asunto: Re: [SQL]

[SQL] Unable to identify an ordering operator '<' for type 'smallint[]'

2006-01-11 Thread Mauricio Fernandez A.
Hello I have been working in a report based on the query bellow. It works fine in my development server which is postgres 8.0 but in production I have postgres 7.3 and I am getting the following error: SQL Error : ERROR: Unable to identify an ordering operator '<' for type 'smallint[]' U

[SQL] Anual Query

2005-11-28 Thread Mauricio Fernandez A.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, Can any of you help me with this query?, I need to retrieve the sum(units) and sum(cost) for each client in every month in the same row, something like this: client|UnJan|CostJan|UnFeb|CostFeb|UnMar|CostMar ...|UnDec|CostDec - -

[SQL] does indexes need statistics?

2005-11-24 Thread Mauricio Fernandez A.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello everybody, Is it necesary the statistics be enabled when I create indexes or to use them? thanks Mauricio Fernández A. Ingeniero de Sistemas U. Autónoma de Manizales -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.0.2i iQA/AwUBQ4X7u84irm

Re: [SQL] Como ejecutar una funcion insert en plpgsql....

2005-11-09 Thread Mauricio Fernandez A.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fernando lo que pasa es que postgres siempre pasa a minusculas los nombres de los campos o tablas excepto si estos se escriben entre comillas. es decir algo como: select CAMPO1 ... postrgres lo pasara a: select campo1 .. y algo como select "CamPo

[SQL] Character set error

2005-10-19 Thread Mauricio Fernandez A.
Good Day. I´m working with postgres 7.4. on Win XP and when I do a query like select* from table it returns me this error message: Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in

Re: [SQL] Convert numeric to money

2005-07-25 Thread Mauricio Fernandez
then 'Implicit cast for expressions and assignments' else 'Implicit cast only for assignments' end) end ) as casttype from pg_cast c, pg_type t, pg_type t1, pg_proc p where c.castsource = t.oid and c.casttarget = t1.oid a

Re: [SQL] PostgreSQL - ERROR: Cannot cast type character varying to integer

2005-07-12 Thread Mauricio Fernandez
CTED] [mailto:[EMAIL PROTECTED] Enviado el: martes, 12 de julio de 2005 13:35 Para: Mauricio Fernandez CC: pgsql-sql@postgresql.org Asunto: Re: [SQL] PostgreSQL - ERROR: Cannot cast type character varying to integer Under PostgreSQL 7.3 it was necessary to use an intermediate cast to text when co

[SQL] PostgreSQL - ERROR: Cannot cast type character varying to integer

2005-07-11 Thread Mauricio Fernandez
Hello I´m new in the list, and I want to learn a lot about postgresql, now I´m working in a database and I have this problem: I have a table called historicoventas as follows (just the structure) > historicoventas > ( > codigopedidovarchar(20) > codigohospital