Re: [SQL] Odd query behavior

2010-03-15 Thread silly sad
On 03/12/10 18:41, Dan McFadyen wrote: Hello, I've come across an odd situation. I've had access to a database where a the following happens: " SELECT * FROM table WHERE name LIKE 'abc%' " returns 2 rows... but... " SELECT * FROM table WHERE name IN (SELECT name FROM table WHERE name LIKE 'ab

Re: [SQL] Odd query behavior

2010-03-15 Thread Tom Lane
"Dan McFadyen" writes: > You're right, the second one does use an index, one that is used to > enforce a unique constraint on the column. I wasn't able to turn it off > as the database is currently in use, and disabling a unique constraint > probably isn't a good idea. > Sorry for not mentioning

Re: [SQL] Odd query behavior

2010-03-15 Thread Dan McFadyen
Bah... yes Windows. For being a developer I certainly miss all the details that make a good bug report/question. Also, sorry about the CC, don't post to lists often and I forget. Now, the interesting part is for all I can tell, there are no special characters in the field. Unless the latest versi

Re: [SQL] Odd query behavior

2010-03-15 Thread Tom Lane
"Dan McFadyen" writes: > Now, the interesting part is for all I can tell, there are no special > characters in the field. Unless the latest version of Pgadmin (1.10.1 or > 1.10.2) hides this from the UI, either that or it's some character that > renders into a similar glyph as ASCII. > Is there a

[SQL] Please delete my email

2010-03-15 Thread Eduardo Palafox
Hi!, I don't want to receive more emails from postgresql. Please remove my email from your delivery list. Thanks _ Prefiero un día sin coche que sin Messenger www.vivirmessenger.com

[SQL] Remove my e-mail

2010-03-15 Thread Daniel Guedes
Hi!, I don't want to receive more emails from postgresql. Please remove my email from your delivery list. Thanks -- Daniel Guedes

Re: [SQL] Please delete my email

2010-03-15 Thread Adrian Klaver
On 03/15/2010 10:18 AM, Eduardo Palafox wrote: Hi!, I don't want to receive more emails from postgresql. Please remove my email from your delivery list. Thanks _ Prefiero un día sin coche

[SQL] I, nead to capture the IP number from the PC how is running the script ...

2010-03-15 Thread John Dizaro
I, nead to capture the IP number from the PC how is running the script "update TABLE1 set campo1 = 123 where ...; " Can someone help me please? -- John Evan Dizaro - Fone: (41) -0303 Fone: (41) 9243-3240 Rua: Alferes Poli Curitiba - PR - Brasil

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
here is example table name is "mail": column| type - sender|char subject |char content |bytea I want copy some record into new table 'mail_new'. sql: create table mail_new as select * from mail sender='dennis' result has an error: operator does not exist:

[SQL] Odd query behavior

2010-03-15 Thread Dan McFadyen
Hello, I've come across an odd situation. I've had access to a database where a the following happens: " SELECT * FROM table WHERE name LIKE 'abc%' "returns 2 rows... but... " SELECT * FROM table WHERE name IN (SELECT name FROM table WHERE name LIKE 'abc%') " returns 0 rows...

[SQL] list of all months

2010-03-15 Thread query
Hi, I want to display data for all days in a month even if no data exists for that month. Some of the days in a month might not have any data at all. With normal query, we can display days only if data exists.But I want to display rows for all days in a month with blank data for non-existing da

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
Hi Ben here is my function , it's for fix missing chunk problem. It has same problem ,please take look thank for you help -table-- db=# \d usersessiontable; Table "public.usersessiontable" Column | Type | Modifiers ---+---

[SQL] Clarification With Money data type

2010-03-15 Thread Navanethan Muthusamy
Hi, I am using Postgresql 8.4, Can you tell me How Can I use Money data type? I want to store the money and retrieve. Please give me idea to work on that. I am using Java with Postgresql, I have tried java.math.BigDecimal with Money, but its giving error. (Its asking me to do the casing) Thanks

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
Postgres : 8.1.4 Dennis Ben Morrow wrote: Quoth dennis: Dear Ben thanks for you anwser. I try to add function quote_literal on my sql statement . but it raise other error message (quote_literal not support bytea format): function quote_literal(bytea) does not exist Which P

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
Dear Ben thanks for you anwser. I try to add function quote_literal on my sql statement . but it raise other error message (quote_literal not support bytea format): function quote_literal(bytea) does not exist Ben Morrow 提到: Quoth dennis : Hi Ben here is my function , it's for fi

Re: [SQL] Remove my e-mail

2010-03-15 Thread Adrian Klaver
On 03/15/2010 10:24 AM, Daniel Guedes wrote: Hi!, I don't want to receive more emails from postgresql. Please remove my email from your delivery list. Thanks To unsubscribe go here: http://www.postgresql.org/mailpref/pgsql-sql Thanks, -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pg

Re: [SQL] I, nead to capture the IP number from the PC how is running the script ...

2010-03-15 Thread Ing. Marcos Ortiz Valmaseda
John Dizaro escribió: I, nead to capture the IP number from the PC how is running the script "update TABLE1 set campo1 = 123 where ...; " Can someone help me please? -- John Evan Dizaro - Fone: (41) -0303 Fone: (41) 9243-3240 Rua: Alferes Poli Curitiba - PR - Brasil inet_client_addr(): ine

Re: [SQL] I, nead to capture the IP number from the PC how is running the script ...

2010-03-15 Thread Gerardo Herzig
John Dizaro wrote: > I, nead to capture the IP number from the PC how is running the script > "update TABLE1 set campo1 = 123 where ...; " > Can someone help me please? > > the pg_stat_activity view has a column named client_addr and a current_query column. That should help. Gerardo -- Sent v

Re: [SQL] list of all months

2010-03-15 Thread Garrett Murphy
I recently ran into the same issue and I resolved it by generating a table of nothing but months for the last 5 years: select TO_CHAR((current_date - interval '1 month' * a),'-MM') AS mm FROM generate_series(1,60,1) AS s(a) "2010-02" "2010-01" "2009-12" "2009-11" "2009-10" … T

Re: [SQL] list of all months

2010-03-15 Thread Petru Ghita
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 One approach could be: You build a table with month information over which you are willing to show data from another table. Then you just cross join your data table and the data in your month table. Here is some code I use for generating the table

Re: [SQL] list of all months

2010-03-15 Thread Dawid Kuroczko
On Mon, Mar 8, 2010 at 13:25, query wrote: > > Hi, > > I want to display data for all days in a month even if no data exists for > that month. Some of the days in a month might not have any data at all. With > normal query, we can display days only if data exists.But I want to display > rows fo

[SQL] installing uuid generators

2010-03-15 Thread Rob Sargent
Stop me if you've heard this one before :) Given that pg_config --libdir yields "/usr/lib64" to where/what would you expect "AS '$libdir/uuid-ossp', 'uuid_generate_v5'" to resolve? The loader script, ~/tools/postgresql-8.4.2/contrib/uuid-ossp/uuid-ossp.sql, generates "tools/postgresql-8.4.2/

Re: [SQL] list of all months

2010-03-15 Thread silly sad
It looks like a procedural problem. I would solve it in plpgsql. -- 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] I, nead to capture the IP number from the PC how is running the script ...

2010-03-15 Thread silly sad
On 03/15/10 22:18, John Dizaro wrote: I, nead to capture the IP number from the PC how is running the script first of all you must tell us how your client is connected to your database? there are a lot of different variants, and the most common of them is not PG related at all while the connec