[SQL] a few Questions about quoted varaibles in psql

2004-02-26 Thread Leo Leo
een? \set foo bar \echo :foo test ==> bar test (but there is a space in between) \echo :foo||test ==> this does not work (I want bartest) Is it somehow possible to do this? Thanks for your help! Leo -- GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...) jetzt 3

[SQL] problem w/plpgsql proc

2001-10-15 Thread leo
near "return" psql:edit_procs.sql:147: ERROR: parser: parse error at or near "if" psql:edit_procs.sql:148: NOTICE: COMMIT: no transaction in progress COMMIT this is part of a larger script, but the function declaration before this works perfectly, so I assume the problem

[SQL] order by day or month, etc

2001-01-02 Thread Leo Xavier
Hello first time I post something... good morning everyone! short presentation: Leo Xavier, Lisbon - Portugal, 17 years, my home-made site: www.megabenfica.com Sql7, win 2000... The question: How for example do I select all entrys from a certain month (of a certain year, of course) ? Or from a

[SQL] Array of Arrays of int

2005-05-01 Thread Leo Fink
r of ints, but I think it all boils down to this simpler example. I am using version 7.4 of PostgreSQL. Thanks a lot, Leo ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Array of Arrays of int

2005-05-01 Thread Leo Fink
Hello Tom. Am 02.05.2005 um 06:11 schrieb Tom Lane: Leo Fink <[EMAIL PROTECTED]> writes: Why does select array(select array[1,2]); give me an error: "could not find array type for data type integer[]"? We don't do arrays of arrays. You seem to be hoping for a 2-D arra

[SQL] error code invalid_input_syntax

2006-01-12 Thread Rainer Leo
Is it possible that this error can not be caught? Thanks Leo ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] uniqueness constraint with NULLs

2009-06-29 Thread Leo Mannhart
On Mon, 2009-06-29 at 17:08 +1000, Robert Edwards wrote: > A. Kretschmer wrote: > > In response to Robert Edwards : > >> Can anyone suggest a way that I can impose uniqueness on a and b when > >> c is NULL? > > > > Sure, use a functional index: > > > > test=# create table bobtest (a int, b int, c

Re: [SQL] two records per row from query

2009-08-06 Thread Leo Mannhart
03 3 | 2009-01-01 00:00:00 | 2009-01-02 00:00:00 | 2102 1 | 2009-01-01 00:00:00 | 2009-01-02 00:00:00 | 2101 (3 rows) Is this what you need or is there something else? Can you give more sample data and the result you expect from it? Cheers, Leo -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] two records per row from query

2009-08-07 Thread Leo Mannhart
myrn = r2.myrn - 1 andr1.mycolcount = 1 order by r1.sessionid, r1.class_date ; rollback; Hope this helps or somebody else has a more elegant solution Cheers, Leo -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread Leo Mannhart
ch size would you > expect performance penalties due to the sole sequence and the BigInt-PKs? > > I first intend to deploy it on an Intel Pentium 2 Duo (2.5-2.8GHz) with 3 GB > RAM and SATA hard disk under Ubuntu Server. > > Thank you very much in advance! > Regards > Rawi che

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread Leo Mannhart
rawi wrote: > > Leo Mannhart wrote: >> Caveat: If you use the standard sequence generator in hibernate, it is >> not using the postgres-sequence in the "usual" manner. hibernate itself >> caches 50 ID's as sequence numbers by default. This means, hibernat

Re: [SQL] Fwd: conditional rule not applied

2010-01-07 Thread Leo Mannhart
-+-+--+- 1 | sh1 |2 | sl1 2 | sh2 |0 | sl3 3 | sh3 |4 | sl2 4 | sh4 |3 | sl3 (4 rows) lem=# Cheers, Leo -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] combine SQL SELECT statements into one

2010-02-01 Thread Leo Mannhart
msi77 wrote: > Hi, > > SELECT > (SELECT COUNT(distinct model) FROM inventory WHERE modified >= '2010-02-01') > as count1, > (SELECT COUNT(distinct model) FROM inventory WHERE modified >= '2010-01-20') > as count2, > (SELECT COUNT(distinct model) FROM inventory WHERE modified >= '2010-01-01') >

[SQL] problem with the Index

2002-10-09 Thread Jose Antonio Leo
I have a problem with the index of 1 table. I hava a table created : CREATE TABLE "acucliart" ( "cod_pto" numeric(8,0) NOT NULL, "cod_cli" varchar(9) NOT NULL, "mes" numeric(2,0) NOT NULL, "ano" numeric(4,0) NOT NULL, "int_art" numeric(5,0) NOT NULL, "cantidad" numeric(1

[SQL] prosgrees + java + trasnacciones

2003-02-07 Thread jose antonio leo
Hola a todos! Intento hacer una aplicacion en java que va contra pgsql y me gustaria bloquear registros. Un jps llama a un metodo de una clase para modificar un registro. Lo primero que hace es una consulta del registro (aquĆ­ quiero bloquear el registro) y despues se muestra en el navegador el res