Re: [GENERAL] deleting function

2009-04-24 Thread pavunkumar
On Apr 24, 8:55 pm, t...@sss.pgh.pa.us (Tom Lane) wrote: > pavunkumar writes: > > create or replace function newd(id integer ) returns void as $$ > > ^^> begin > > delete from testing where id=$1; > > ^^ > > > end; > > $$ > > language '

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-24 Thread nighthawk
On Thu, Apr 2, 2009 at 3:33 PM, linnewbie wrote: > set page_content [lindex [ dbh $sql ] 0] I have never heard of tclodbc, but I believe you are putting the first row into your variable, which is why it shows with curly braces. The problem should be more obvious when you try to fetch more than o

Re: [GENERAL] Can't use "any" with SQL functions

2009-04-24 Thread Tom Lane
Alvaro Herrera writes: > BTW is there a reason the error messages say "plpgsql functions cannot > ..." instead of "PL/pgSQL functions cannot ..."? Somewhere along the line there was the idea that the messages ought to match the "real" name of the PL language, which is plpgsql. The other name is

Re: [GENERAL] delete duplicates takes too long

2009-04-24 Thread Alvaro Herrera
Miguel Miranda escribió: > I cant use a unique index because i only want to check for duplicates where > processed = 2, for simplicity i did not include that condition in the > example. In that case you can create a partial unique index: create index foo on cdr_ama_stat (abonado_a, abonado_b, fec

Re: [GENERAL] delete duplicates takes too long

2009-04-24 Thread Miguel Miranda
I cant use a unique index because i only want to check for duplicates where processed = 2, for simplicity i did not include that condition in the example. On Fri, Apr 24, 2009 at 5:50 PM, Scott Marlowe wrote: > On Fri, Apr 24, 2009 at 5:37 PM, Miguel Miranda > wrote: > > hi , i hava a table: > >

Re: [GENERAL] delete duplicates takes too long

2009-04-24 Thread Scott Marlowe
On Fri, Apr 24, 2009 at 5:37 PM, Miguel Miranda wrote: > hi , i hava a table: > CREATE TABLE public.cdr_ama_stat ( > id int4 NOT NULL DEFAULT nextval('cdr_ama_stat_id_seq'::regclass), > abonado_a varchar(30) NULL, > abonado_b varchar(30) NULL, > fecha_llamada timestamp NULL, > duracion int4 NULL,

[GENERAL] delete duplicates takes too long

2009-04-24 Thread Miguel Miranda
hi , i hava a table: CREATE TABLE public.cdr_ama_stat ( id int4 NOT NULL DEFAULT nextval('cdr_ama_stat_id_seq'::regclass), abonado_a varchar(30) NULL, abonado_b varchar(30) NULL, fecha_llamada timestamp NULL, duracion int4 NULL, puerto_a varchar(4) NULL, puerto_b varchar(4) NULL, tipo_llamada char(

Re: [GENERAL] Selling an 8.1 to 8.3 upgrade

2009-04-24 Thread Scott Marlowe
On Fri, Apr 24, 2009 at 11:01 AM, Josh Trutwin wrote: > I've been asked to put together a list of reasons to upgrade a db > from 8.1 to 8.3 and I've looked over the changelog, but they want a > bullet list of 4-5 top things.  I'm curious what others would say the > most 5 important updates from 8.

Re: [GENERAL] Can't use "any" with SQL functions

2009-04-24 Thread Alvaro Herrera
BTW is there a reason the error messages say "plpgsql functions cannot ..." instead of "PL/pgSQL functions cannot ..."? -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-general m

Re: [GENERAL] Selling an 8.1 to 8.3 upgrade

2009-04-24 Thread Ivan Sergio Borgonovo
On Fri, 24 Apr 2009 13:03:06 -0600 Scott Marlowe wrote: > On Fri, Apr 24, 2009 at 11:01 AM, Josh Trutwin > wrote: > > I've been asked to put together a list of reasons to upgrade a db > > from 8.1 to 8.3 and I've looked over the changelog, but they > > want a bullet list of 4-5 top things.  I'm

Re: [GENERAL] Can't use "any" with SQL functions

2009-04-24 Thread Tom Lane
Decibel! writes: > Is there a reason we disallow using "any" with SQL functions? Yes. Try "anyelement" instead. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailp

Re: [GENERAL] Determining the names of columns in a dynamic query

2009-04-24 Thread Decibel!
My MTA says your email domain doesn't exist... On Apr 24, 2009, at 1:27 PM, Johan Nel wrote: Sorry for cross posting, but seems nobody read the pgsql.sql NG. Have not received any response there so lets see if this create some reaction. Is it possible in pgsql to have something to manipula

Re: [GENERAL] deleting function

2009-04-24 Thread Raymond O'Donnell
On 24/04/2009 14:03, pavunkumar wrote: > create or replace function newd(id integer ) returns void as $$ > begin > delete from testing where id=$1; > end; I'd guess it's because the column name, "id", is the same as the argument name - plpgsql thinks that "id" in the DELETE statement is the argume

[GENERAL] Can't use "any" with SQL functions

2009-04-24 Thread Decibel!
Is there a reason we disallow using "any" with SQL functions? deci...@phonebook.local=# create function textcoalesce("any") returns void language sql as $$SELECT coalesce( $1::text, '' )$$; ERROR: SQL functions cannot have arguments of type "any" STATEMENT: create function textcoalesce("any"

Re: [GENERAL] Selling an 8.1 to 8.3 upgrade

2009-04-24 Thread Greg Smith
On Fri, 24 Apr 2009, Scott Marlowe wrote: Improved vacuuming, including multi-threaded vacuum capability. That's multi-process vacuum capability; don't you know you can't use the T-word on these lists? Scott's list is similar to the one I'd come up. To summarize the main items on there, t

Re: [GENERAL] Selling an 8.1 to 8.3 upgrade

2009-04-24 Thread Josh Trutwin
Thanks for all the replies, I'm picking this one to reply to. Winner! On Fri, 24 Apr 2009 13:40:29 -0400 Brad Nicholson wrote: > On Fri, 2009-04-24 at 12:01 -0500, Josh Trutwin wrote: > > I've been asked to put together a list of reasons to upgrade a db > > from 8.1 to 8.3 and I've looked over

Re: [GENERAL] deleting function

2009-04-24 Thread Tom Lane
pavunkumar writes: > create or replace function newd(id integer ) returns void as $$ ^^ > begin > delete from testing where id=$1; ^^ > end; > $$ > language 'plpgsql'; Don't use the same name for a parameter as you use for a table colu

Re: [GENERAL] feature suggestion and return to pgsql-general :-)

2009-04-24 Thread Merlin Moncure
On Fri, Apr 24, 2009 at 12:53 AM, Dennis Gearon wrote: > > Hi guys, I am back after a long time of doing other kinds of work. Don't know > if anybody remembers me - not a biggee. > > I am again working on a design of a web application for myself. Security > seems MUCH more of an issue, EVERY day

[GENERAL] Determining the names of columns in a dynamic query

2009-04-24 Thread Johan Nel
Hi, Sorry for cross posting, but seems nobody read the pgsql.sql NG. Have not received any response there so lets see if this create some reaction. Is it possible in pgsql to have something to manipulate columns where the column names will only be resolved during execution of the select sta

Re: [GENERAL] standard_conforming_strings and pg_escape_string()

2009-04-24 Thread Conrad Lender
On 24/04/09 14:49, Daniel Verite wrote: > It works for me: > > $ php -e > echo phpversion(), "\n"; > $c=pg_connect("dbname=mail user=daniel host=/tmp port=5000"); > pg_query("SET standard_conforming_strings=off"); > echo pg_escape_string('toto\titi'), "\n"; > pg_query("SET standard_conforming_str

Re: [GENERAL] Selling an 8.1 to 8.3 upgrade

2009-04-24 Thread Brad Nicholson
On Fri, 2009-04-24 at 12:01 -0500, Josh Trutwin wrote: > I've been asked to put together a list of reasons to upgrade a db > from 8.1 to 8.3 and I've looked over the changelog, but they want a > bullet list of 4-5 top things. I'm curious what others would say the > most 5 important updates from 8.

Re: [GENERAL] Selling an 8.1 to 8.3 upgrade

2009-04-24 Thread Joao Ferreira gmail
pg 8.1.4 has a very ugly bug which prevents VACUUM and AUTOVACUUM from performing well I certain situations the AUTOVACUUM will start failing and any VACUUM operations will fail too. solution I found was to periodically REINDEX my tables and INDEXES. the major effect of this bug is Pg starts

[GENERAL] Selling an 8.1 to 8.3 upgrade

2009-04-24 Thread Josh Trutwin
I've been asked to put together a list of reasons to upgrade a db from 8.1 to 8.3 and I've looked over the changelog, but they want a bullet list of 4-5 top things. I'm curious what others would say the most 5 important updates from 8.1 to 8.3 are. I can say "performance improvevents" but I'm no

Re: [GENERAL] need help for PostgreSQL consistency check mechanism

2009-04-24 Thread Alvaro Herrera
Filip Rembiałkowski escribió: > OTOH, there could be some consistency check method... If postgres had block- > or row-level checksums, this could do. Row level: it would be very expensive to compute, store and keep up to date. And it doesn't protect you from corruption elsewhere in the block. B

Re: [GENERAL] need help for PostgreSQL consistency check mechanism

2009-04-24 Thread Filip Rembiałkowski
2009/4/24 Joshua D. Drake > On Fri, 2009-04-24 at 10:04 -0400, Alvaro Herrera wrote: > > Chen, Dongdong (GE Healthcare) escribió: > > > > > > When the OS starts up, it wants to detect whether there is data loss > > > in PostgreSQL from last shutdown, is there a method provided? > > > > Why would

Re: [GENERAL] OperationalError: FATAL: could not open file : Too many open files in system

2009-04-24 Thread Erik Jones
On Apr 23, 2009, at 1:39 PM, Ben Welsh wrote: Hello, I'm managing a pgsql->django->mod_python->apache machine that serves no media, but handles postgres, memcached and apache all by itself. Recently I've begun drawing "too many open files in the system" errors, as seen in the subject lin

Re: [GENERAL] deleting function

2009-04-24 Thread Sam Mason
On Fri, Apr 24, 2009 at 11:55:48AM -0400, Tom Lane wrote: > pavunkumar writes: > > create or replace function newd(id integer ) returns void as $$ > > delete from testing where id=$1; > > Don't use the same name for a parameter as you use for a table column > referenced in the function. I've fou

[GENERAL] deleting function

2009-04-24 Thread pavunkumar
Dear Friends I have table called below I need to delete the record by using id value of the table For that I wrote below function create or replace function newd(id integer ) returns void as $$ begin delete from testing where id=$1; end; $$ language 'plpgsql'; Here I call the function as " selec

Re: [GENERAL] need help for PostgreSQL consistency check mechanism

2009-04-24 Thread Joshua D. Drake
On Fri, 2009-04-24 at 10:04 -0400, Alvaro Herrera wrote: > Chen, Dongdong (GE Healthcare) escribió: > > > > When the OS starts up, it wants to detect whether there is data loss > > in PostgreSQL from last shutdown, is there a method provided? > > Why would the OS want to do that? That doesn't m

Re: [GENERAL] standard_conforming_strings and pg_escape_string()

2009-04-24 Thread Tom Lane
Conrad Lender writes: > On 24/04/09 00:56, Tom Lane wrote: >> The above cannot possibly work. pg_escape_string is generating what it >> supposes to be a normal string literal, and then you are sticking an 'E' >> on the front which changes the escaping rules. It is not the function's >> fault tha

Re: [GENERAL] update error

2009-04-24 Thread Tom Lane
josep porres writes: > So, what's the point of the alias in the documentation? You might want the alias elsewhere in the command, in places where it's actually possible to refer to more than one table. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-gene

Re: [GENERAL] need help for PostgreSQL consistency check mechanism

2009-04-24 Thread Alvaro Herrera
Chen, Dongdong (GE Healthcare) escribió: > > When the OS starts up, it wants to detect whether there is data loss > in PostgreSQL from last shutdown, is there a method provided? Why would the OS want to do that? -- Alvaro Herrerahttp://www.CommandPrompt.com/ Pos

Re: [GENERAL] standard_conforming_strings and pg_escape_string()

2009-04-24 Thread Daniel Verite
Conrad Lender wrote: I would like our database abstraction to be able to handle both settings for standard_conforming_strings transparently, i.e. perform the escaping according to the current DB server settings. Since pg_escape_string() is aware of the current database connection, I

Re: [GENERAL] update error

2009-04-24 Thread josep porres
So, what's the point of the alias in the documentation? -> http://www.postgresql.org/docs/current/static/sql-update.html 2009/4/24 Filip Rembiałkowski > > > 2009/4/24 josep porres > >> Hello, >> >> I am migrating a database to pg and modifying the app. >> In that process I found an error and i

Re: [GENERAL] update error

2009-04-24 Thread josep porres
ok, it's working without the alias inside the SET thanks 2009/4/24 Filip Rembiałkowski > > > 2009/4/24 josep porres > >> Hello, >> >> I am migrating a database to pg and modifying the app. >> In that process I found an error and i don't see the reason. >> >> It's happening when executing the n

Re: [GENERAL] update error

2009-04-24 Thread Filip Rembiałkowski
2009/4/24 josep porres > Hello, > > I am migrating a database to pg and modifying the app. > In that process I found an error and i don't see the reason. > > It's happening when executing the next update sentence > Do you see what's wrong? table name / alias is not allowed in SET section. http

[GENERAL] update error

2009-04-24 Thread josep porres
Hello, I am migrating a database to pg and modifying the app. In that process I found an error and i don't see the reason. It's happening when executing the next update sentence Do you see what's wrong? The server is pg8.3.7 for w32 ___

Re: [GENERAL] need help for PostgreSQL consistency check mechanism

2009-04-24 Thread Chen, Dongdong (GE Healthcare)
When the OS starts up, it wants to detect whether there is data loss in PostgreSQL from last shutdown, is there a method provided? Thanks for your help! B.R. ChenDongdong -Original Message- From: Scott Marlowe [mailto:scott.marl...@gmail.com] Sent: Friday, April 24, 2009 10:29 AM

[GENERAL] Question regarding pam_pgsql [looking for a BSD License pam_pgsql]

2009-04-24 Thread Dhaval Shah
I have a need to authenticate a SSH session against the database. For that I was looking for a pam_pgsql module which is at least of BSD license. My search on the web throws several options and some of them [or all?] are linked against "mhash" which again seems to be of GPL 2 license. So is there