[SQL] i can't connect after some periode

2008-07-10 Thread aldy
hi all, i have some problems with my postgresql database server : i develop some client-server program using postgre as its database (used by almost 100 client), my problem comes after some periode of time( some times 1 day) i can't connect to the database include from pgadmin, and i must resta

Re: [SQL] i can't connect after some periode

2008-07-10 Thread A. Kretschmer
am Thu, dem 10.07.2008, um 13:57:15 +0700 mailte aldy folgendes: > hi all, First, don't hijack other threads, your mail contains a References-header: References: <[EMAIL PROTECTED]> But this message contains to an other thread. In other words: don't answer to an email by deleting the body and c

Re: [SQL] i can't connect after some periode

2008-07-10 Thread aldy
From: "A. Kretschmer" <[EMAIL PROTECTED]> Sent: Thursday, July 10, 2008 14:14 First, don't hijack other threads, your mail contains a References-header: owkay, i'm sorry for that Maybe the clients do not close the connection and after some time you have more than 'max_connections' (Default

[SQL] Design and Question

2008-07-10 Thread PostgreSQL Admin
Hi, I have BOTH a sql AND db design question. I'm creating a cookbook DB with have broken the table into this: RECIPE TABLE Column | Type | Modifiers ---+--+-- id | integer | not null default nextval('r

[SQL] Problem in dynamic query execution in plpgsql

2008-07-10 Thread Anoop G
Hai all, I Have a problem,I have a plpgsql function == CREATE OR REPLACE FUNCTION function_to_get_ticket_wise_sales(VARCHAR,VARCHAR) RETURNS SETOF RECORD AS ' DECLARE dat_from_date ALIAS FOR $1; dat_to_date ALIAS FOR $2; dat_from DATE; dat_to DATE; vchr_

[SQL] record type

2008-07-10 Thread Marcin Krawczyk
Hi. I need to know whether it's possible for a plpgsql function to accept record type parameters ? Is there a way to accomplish that ? I need to use something like ('1','2','3') as a parameter. regards mk

Re: [SQL] Problem in dynamic query execution in plpgsql

2008-07-10 Thread Pavel Stehule
Hello why you do use dynamic query? your function is little bit ugly a) create or replace function ..(date_from date, date_to date) returns setof record as $$ declare r record; begin for r in select .. from tbl_ticket where dat_ticket_issue between date_from and date_to loop ... b) for s

Re: [SQL] Problem in dynamic query execution in plpgsql

2008-07-10 Thread A. Kretschmer
am Thu, dem 10.07.2008, um 18:25:38 +0530 mailte Anoop G folgendes: > my problems are: > > 1 problem : in RAISE NOTICE query string is print like this, > > How i can put the dates in single quote in a dynamic query string? Use more quotes *g*: Example: test=*# create or replace function my_fo

Re: [SQL] i can't connect after some periode

2008-07-10 Thread Lennin Caro
what is the message error? i have a similar problem whit a software, this software not closed the connection to the server and not reuse the previously open. --- On Thu, 7/10/08, aldy <[EMAIL PROTECTED]> wrote: > From: aldy <[EMAIL PROTECTED]> > Subject: [SQL] i can't connect after some peri

Re: [SQL] i can't connect after some periode

2008-07-10 Thread Lennin Caro
--- On Thu, 7/10/08, aldy <[EMAIL PROTECTED]> wrote: > From: aldy <[EMAIL PROTECTED]> > Subject: Re: [SQL] i can't connect after some periode > To: pgsql-sql@postgresql.org > Date: Thursday, July 10, 2008, 8:16 AM > From: "A. Kretschmer" > <[EMAIL PROTECTED]> > Sent: Thursday, July 10, 2008 14:

Re: [SQL] i can't connect after some periode

2008-07-10 Thread Scott Marlowe
On Thu, Jul 10, 2008 at 8:22 AM, Lennin Caro <[EMAIL PROTECTED]> wrote: > > > > --- On Thu, 7/10/08, aldy <[EMAIL PROTECTED]> wrote: > >> From: aldy <[EMAIL PROTECTED]> >> Subject: Re: [SQL] i can't connect after some periode >> To: pgsql-sql@postgresql.org >> Date: Thursday, July 10, 2008, 8:16 AM

[SQL] Converting Copy to insert statement in backup file

2008-07-10 Thread Chris Preston
Hello, I have a backup cron job (shown below) but its too big and there are times that I want to just cut out from the text file certain areas to restore data in a specific table. Looking in the file, I notice there is a "copy" command.. Someone told me that there was a parameter that I could use

Re: [SQL] Converting Copy to insert statement in backup file

2008-07-10 Thread Scott Marlowe
On Thu, Jul 10, 2008 at 9:40 AM, Chris Preston <[EMAIL PROTECTED]> wrote: > Hello, > > I have a backup cron job (shown below) but its too big and there are times > that I want to just cut out from the text file certain areas to restore data > in a specific table… Looking in the file, I notice there

Re: [SQL] Design and Question

2008-07-10 Thread Niklas Johansson
On 10 jul 2008, at 14.50, PostgreSQL Admin wrote: How do I combine the two in a query? If you're looking for recipes that match *either* criterion (season *or* diet), you could add the two subqueries generating the ids using UNION or UNION ALL: SELECT title FROM recipes WHERE id IN ( SEL

[SQL] record type

2008-07-10 Thread Marcin Krawczyk
Or maybe anyone knows how to work with record types ? How to insert something like ('1','2','3') into a table, or split it ? Anything ? regards mk