Re: [SQL] Private functions

2010-03-15 Thread silly sad
On 03/14/10 06:21, Jasen Betts wrote: On 2010-03-13, Gianvito Piopio.gianv...@gmail.com wrote: Hi all, is there a way to write a function that can only be called by another function but not directly using SELECT function_name ( )? not really. but there may be another way to get the effect

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

Re: [SQL] Odd query behavior

2010-03-15 Thread Tom Lane
Dan McFadyen d...@cryptocard.com 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

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

Re: [SQL] Odd query behavior

2010-03-15 Thread Tom Lane
Dan McFadyen d...@cryptocard.com 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.

[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

[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

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

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

2010-03-15 Thread dennis
Postgres : 8.1.4 Dennis Ben Morrow wrote: Quoth dennisden...@teltel.com: 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

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 den...@teltel.com: Hi Ben here is my

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

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(): inet

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 via

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 … Then I did

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 search2...@rediffmail.com 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

[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