[ADMIN] reg:reading files from the DB

2005-12-27 Thread sandhya
Hi.

I used one function where in we can read the contents of the file from the
database.
Whenever there is a request for the specified file it should take the
contents from the database.
I have exported all my files to databaseand in webserver when ever there
is a request fro the file i am opening and reading it
from the database.
I have connected to DB server remotely and executing.
Please tell me how to proceed.
When ever there is a request for the particular file i am getting the Object
id and passing it to the following function.
Is this correct?
please suggest me .
voi d GetFiles(PGconn *conn, unsigned int lobjId, int start)
{

-



int lobj_fd;

lobj_fd = lo_open(conn, lobjId, INV_READ);

if (lobj_fd < 0)

{

MessageBox(0,"error","Cannot Object Id ",MB_OK);

}

lo_lseek(conn, lobj_fd, start, SEEK_END);

len = lo_tell(conn,lobj_fd);

lo_lseek(conn, lobj_fd, start, SEEK_SET);

buf =(char*) malloc(len + 1);

nread = 0;

while (len - nread > 0)

{

nbytes = lo_read(conn, lobj_fd, buf, len - nread);

buf[nbytes] = ' ';

nread += nbytes;

}

MessageBox(0,"Inside get","test",MB_OK);

free(buf);

lo_close(conn, lobj_fd);

}

Thank you.
Sandhya

- Original Message - 
From: "Tom Lane" <[EMAIL PROTECTED]>
To: "sandhya" <[EMAIL PROTECTED]>
Cc: "postgre" 
Sent: Monday, December 26, 2005 9:08 PM
Subject: Re: [ADMIN] reg:lseek&read ..pls


> "sandhya" <[EMAIL PROTECTED]> writes:
> > But before that i need to know the size of the object from which i am =
> > trying to get the contents.
> > How can i do this?
>
> Same way you'd do it for a Unix file: seek to the end, note the end
> offset, seek back to the start and read.
>
> ... lo_open ...
> lo_size = lo_lseek(conn, fd, 0, SEEK_END);  // where's the end?
> lo_lseek(conn, fd, 0, SEEK_SET);  // go back to start
>
> regards, tom lane
>
> ---(end of broadcast)---
> TIP 2: Don't 'kill -9' the postmaster
>




---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[ADMIN] sending mail from Postgres

2005-12-27 Thread Aftab Alam
Hi there,

How can i send mail form postgresql.

any suggestion.

thanx & regards
aftab

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[ADMIN] preventing deadlocks

2005-12-27 Thread Tsirkin Evgeny


Hi list!
My issue is as follows :
I have to do some  calculations based on *exact* number of rows in 2 
tables (with a filter) meaning:

SELECT count(*) FROM a WHERE a.row1 in (1,2,3,4);
SELECT count(*) FROM b WHERE b.row1 in (1,2,3,4);
However i couldn't use the count(*) since it is too slow beacause of the 
table size.
So,i created a trigger that on insert increments and on delete 
decriments special "counter" table

that contains
\d counter
   Column| Type  | Modifiers
--+---+---
counter_type | character varying(30) |    the 
table name (a or b)
ident| numeric(10,0) |  
the
count| integer   
|   the count



The problem of course is the locking issues while changing a and b 
tables.What i am doing now is to
select 1 from counter  where counter_type='a' and ident in (1,2,3,4) for 
update;
select 1 from counter  where counter_type='b' and ident in (5,6,7) for 
update;
Befor changing anything in tables "a" and "b"  in transaction .I am also 
doing for update select on the

"a" and "b" tables itself ,that is:
select b from a  where pkey in (5,6,7) for update;

My problems:
[1] Is the for update lock anouth here?
[2] The "for update" queries  HAVE to be done in the same order in all 
application which is pretty error prone -

it is very easy to forget in one place and get a deadlock.
[3] Can i make a trigger that automatically locks the counter_type='b' 
if a for update select was done on table b?

something like (pseudo):
trigger on select for update table b{
   select for update where ident = OLD.pkey ;
}
[4] Can i combine queries for multiple tables to make locking atomic:
select 1 from b,counter where b.pkey in (1,2,3,4) and counter.ident in 
(1,2,3,4);

Hope for help and sorry for long message.
evgeny



---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


[ADMIN] How to run a posgresql function/procedure thro crontab in Linux ES 4.0

2005-12-27 Thread Murugan G
Title: How to run a posgresql function/procedure thro crontab in Linux ES 4.0






Hello,

If anybody tried, please let me know how to run a postgresQL function/procedure thro crontab in Linux ES 4.0


Thanks and regards,

G.Murugan,
Sr. Software Engineer.

Extn. 1658

===
Sobha Renaissance Information Technology Private Limited
An SEI-CMM & P-CMM Level 5 Company

World's 1st SSE-CMM Level 5 Company

BS 7799 certified by British Standards Institute

ISO 9001:2000 Certified by TÜV Rheinland/Berlin-Brandenburg

A Six Sigma Practice Company 

Tel: + 91 80 51951999; Fax: + 91 80 51523300; Video Conference: + 91 80 5125
Email : murugan.g@renaissance-it.com; Web: www.renaissance-it.com
===
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete all copies from any computer.





[ADMIN] Procedure in PostgresQL

2005-12-27 Thread Murugan G
Title: Procedure in PostgresQL






Hello,

Is there any way to create procedure in postgresQL.


Thanks and regards,

G.Murugan,
Sr. Software Engineer.

Extn. 1658

===
Sobha Renaissance Information Technology Private Limited
An SEI-CMM & P-CMM Level 5 Company

World's 1st SSE-CMM Level 5 Company

BS 7799 certified by British Standards Institute

ISO 9001:2000 Certified by TÜV Rheinland/Berlin-Brandenburg

A Six Sigma Practice Company 

Tel: + 91 80 51951999; Fax: + 91 80 51523300; Video Conference: + 91 80 5125
Email : murugan.g@renaissance-it.com; Web: www.renaissance-it.com
===
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete all copies from any computer.





Re: [ADMIN] Procedure in PostgresQL

2005-12-27 Thread Larry Rosenman

On Dec 27 2005, Murugan G wrote:


Hello,
Is there any way to create procedure in postgresQL.


Yes, look at the docs on PL/pgSQL and the other PL's:


http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS
http://www.postgresql.org/docs/current/static/plpgsql.html




Thanks and regards, G.Murugan, Sr. Software Engineer. Extn. 1658 
=== 
Sobha Renaissance Information Technology Private Limited An SEI-CMM & 
P-CMM Level 5 Company World's 1st SSE-CMM Level 5 Company BS 7799 
certified by British Standards Institute ISO 9001:2000 Certified by TÜV 
Rheinland/Berlin-Brandenburg A Six Sigma Practice Company Tel: + 91 80 
51951999; Fax: + 91 80 51523300; Video Conference: + 91 80 5125 Email
: [EMAIL PROTECTED]; Web: www.renaissance-it.com 
 
=== 
The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged 
material. Any review, retransmission, dissemination or other use of, or 
taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is prohibited. If you received 
this in error, please contact the sender and delete all copies from any 
computer.






-- Larry Rosenman, Database Support Engineer, E-Mail: 
[EMAIL PROTECTED] Pervasive Software, 12365B Riata Trace 
Parkway, Austin, TX 78727 Office: 512-231-6173



---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [ADMIN] How to run a posgresql function/procedure thro crontab

2005-12-27 Thread Koen Martens

Murugan G wrote:


Hello,
If anybody tried, please let me know how to run a postgresQL 
function/procedure thro crontab in Linux ES 4.0




$ psql --help

This is psql 8.1.0, the PostgreSQL interactive terminal.

..
 -c COMMAND  run only single command (SQL or internal) and exit
..


So just put a proper invocation of psql in cron, eg something like:

0 * * * * /path/to/binary/psql -U foo -h yourhost.com -c "select bar()" 
dbname 1> /dev/null


Gr,

Koen

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [ADMIN] sending mail from Postgres

2005-12-27 Thread Michael Fuhr
On Tue, Dec 27, 2005 at 02:44:32PM +0530, Aftab Alam wrote:
> How can i send mail form postgresql.

You could write a function in a language like plperlu, pltclu, or
plpython, but a problem with functions that have effects outside
the database is that those effects can't be undone if the transaction
rolls back.  A common example is a trigger that sends email when a
table is changed: if the trigger fires and then you roll back the
transaction, it's too late to cancel the email.  Depending on what
you're doing it might be better to use LISTEN/NOTIFY and have a
client program send email when it receives a notification (notifications
are sent only when the transaction commits).

-- 
Michael Fuhr

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [ADMIN] file in posgres

2005-12-27 Thread Jim C. Nasby
On Thu, Dec 22, 2005 at 07:30:56AM -0800, Alain Rodriguez Arias wrote:
> Ok I'm using the EMS PostgreSQL Manager Pro utility to export my data into a
> XML, the thing is that when I got a bytea field, which i use to save files,
> when i tried to import the XML I have just create the file is corrupt.
> I believe it has something to do with the XML encoding I'using or something
> like that???
> Any help please.
> The bytea field I'm using it to save PDF file!

Can you post the first portion of the suspected bad XML?

 
> > What do you mean with this???
> >  *binary data in XML needs to be uuencoded afaik,*

XML only allows data within a certain range of values. I'm pretty sure
that you can't just stick raw binary data into XML without ensuring that
it won't contain certain invalid characters, and the most common way to
do that is to base-64 (or uuencode) it.

man uuencode on a unix/linux/OS X box should provide more info.

> >  On 12/19/05, Jim Nasby <[EMAIL PROTECTED]> wrote:
> > >
> > > Including -admin back in the discussion...
> > >
> > > Well, binary data in XML needs to be uuencoded afaik, and of course
> > > you'll want to put it in a CDATA block.
> > >
> > > PostgreSQL doesn't have any XML support built-in, but there's at least
> > > one project that has stuff to help deal with XML. I think it's in 
> > > pgFoundry,
> > > though there may be some stuff in contrib as well.
> > >
> > > -Original Message-
> > > From: Alain Rodriguez Arias [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, December 19, 2005 3:10 PM
> > > To: Jim Nasby
> > > Subject: Re: [ADMIN] file in posgres
> > >
> > >
> > > Naybe you missunderstood me, i need to export all the data of a table
> > > into an XML format, and I'm afraid to have any trouble with the bytea data
> > > type that I use to store files.  Can't you tell if there is any problem 
> > > with
> > > that and if not how do I do the export to XML???
> > >
> > >
> > > On 12/19/05, Jim C. Nasby <[EMAIL PROTECTED]> wrote:
> > > On Sat, Dec 17, 2005 at 02:45:08PM -0800, Alain Rodriguez Arias wrote:
> > > > Hi everybody:
> > > > I need that somebody tell me if there is any way to save a file of any
> > > kind
> > > > in a field of a database in posgres??
> > >
> > > http://www.postgresql.org/docs/8.1/static/datatype-binary.html
> > >
> > > > I also need to  convert the data of a tble into  XML???
> > >
> > > No reason to do that in the database... though if you end up storing XML
> > > you should just stick it in a text field.
> > > --
> > > Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
> > > Pervasive Software  http://pervasive.comwork: 512-231-6117
> > > vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461
> > >
> > > ---(end of broadcast)---
> > > TIP 4: Have you searched our list archives?
> > >
> > >   http://archives.postgresql.org
> > >
> >
> >

-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [ADMIN] Users + Groups = Roles, duplicate name issue

2005-12-27 Thread Jim C. Nasby
Bummer, it looks like there isn't any good solution for the case of
identical user and group names. You might want to search through the
archives to see if this scenario was discussed when roles were being
designed, but it looks like your best bet is to rename either the user
or the group before dumping.

On Thu, Dec 22, 2005 at 02:32:53AM +, ljb wrote:
> [EMAIL PROTECTED] wrote:
> > Which version of pg_dump did you use to dump the old database? The
> > recommended procedure is to use the newer version of pg_dump (ie:
> > pg_dump from 8.1.1) to dump the old database. It's possible that the
> > newer version of pg_dump has facilities in place to deal with this.
> > Those facilities would obviously be missing from older versions.
> 
> Good suggestion.  I was using the 7.4.x pg_dumpall.  So I tried using 8.1.1
> pg_dumpall to see what would happen.  I got the same results - both users
> had rights on both tables after the reload, except for one difference: when
> the 7.4.x database was dumped with 8.1.1 and reloaded into 8.1.1, the
> duplicate user/group name 'test' was not valid for login.  I don't know if
> this is intentional or just a side effect of processing groups after users.
> The 8.1.1 pg_dumpall generated these commands:
> 
>   CREATE ROLE ljb;
>   ALTER ROLE ljb WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN ...
>   CREATE ROLE test;
>   ALTER ROLE test WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN ...
> * CREATE ROLE test;
> + ALTER ROLE test WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN;
>   CREATE ROLE acct;
>   ALTER ROLE acct WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN;
>   GRANT test TO ljb;
>   GRANT acct TO test;
> 
> The second CREATE ROLE test (marked *) gets an error: role already exists,
> just like it does using the 7.4.x dump, and is ignored. But unlike the
> 7.4.x dump, here the second ALTER ROLE (marked +) results in the nologin
> flag being set for test (because it is looking at the test group at this
> point, I presume). The end result is that one user 'ljb' now has rights to
> a table that was not accessible before, and the other user 'test' can't log
> in now.
> 
> For reference, here is the setup:
>   create group test;
>   create group acct;
>   create user ljb with password '...' in group test;
>   create user test with password '...' in group acct;
>   create table test_data (id integer);
>   create table money_data (id integer);
>   grant all on test_data to group test;
>   grant all on money_data to group acct;
> 
> ---(end of broadcast)---
> TIP 2: Don't 'kill -9' the postmaster
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [ADMIN] Pgstat.tmp file activity

2005-12-27 Thread Jim C. Nasby
On Fri, Dec 23, 2005 at 04:50:32PM +1100, Dan Austin wrote:
> > [...]
> > Right, the file is fully written under a temp name, and then 
> > rename()'d
> 
> This makes sense and is almost certainly not the cause of the problem.
> Although there is a lot more data being written to that file than I
> would have thought.
> 
> One of Sun's kernel engineers has come up with a solution that seems to
> have fixed the problem. Instead of increasing work_mem (which we still
> might do) we've mounted a swapfs partition over the pg temp directory:
> 
>   # mount | grep pgsql_tmp
>   /export/data/pgsql/data/base/64920741/pgsql_tmp on swap [...]
> 
> This has actually reduced the disk activity considerably. So far, the
> blocking problem seems to have gone.
> 
> Now to find some Postgres DBAs in Sydney to do some review / tuning of
> our memory settings. :-)

Note also that Solaris by default limits the amount of memory used for
disk caching, which is Not Good for PostgreSQL. IIRC this can be changed
with a sysctl, but I don't recall the details off-hand.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [ADMIN] Pgstat.tmp file activity

2005-12-27 Thread Tom Arthurs

From http://docs.sun.com/source/817-1836-10/perfplat.html

High File System Page-in Rate

If you are seeing high file system page-in rates on Solaris 8 or 9, you 
may benefit from increasing the value of segmap_percent. This parameter 
is set by adding the following line to the /etc/system file:


set segmap_percent=25

segmap_percent adjusts the percentage of memory that the kernel will map 
into its address space for the file system cache. The default value is 
12; that is, the kernel will reserve enough space to map at most 12% of 
memory for the file system cache. On a heavily loaded machine with 4 GB 
of physical memory, improvements have been seen with values as high as 
60. You should experiment with this value, starting with values around 
25. On systems with large amounts of physical memory, you should raise 
this value in small increments, as it can significantly increase kernel 
memory requirements.



I think this can also be set with the kernel debugger.

I keep it at 50% on my E3500 and E4500 systems (8 and 12 GB memory).

Jim C. Nasby wrote:


On Fri, Dec 23, 2005 at 04:50:32PM +1100, Dan Austin wrote:
 


[...]
Right, the file is fully written under a temp name, and then 
rename()'d
 


This makes sense and is almost certainly not the cause of the problem.
Although there is a lot more data being written to that file than I
would have thought.

One of Sun's kernel engineers has come up with a solution that seems to
have fixed the problem. Instead of increasing work_mem (which we still
might do) we've mounted a swapfs partition over the pg temp directory:

 # mount | grep pgsql_tmp
 /export/data/pgsql/data/base/64920741/pgsql_tmp on swap [...]

This has actually reduced the disk activity considerably. So far, the
blocking problem seems to have gone.

Now to find some Postgres DBAs in Sydney to do some review / tuning of
our memory settings. :-)
   



Note also that Solaris by default limits the amount of memory used for
disk caching, which is Not Good for PostgreSQL. IIRC this can be changed
with a sysctl, but I don't recall the details off-hand.
 




---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [ADMIN] Pgstat.tmp file activity

2005-12-27 Thread Jim C. Nasby
There's also a non-percent-based control as well. My understanding is
that segmap_percent doesn't work on some versions or architectures,
notably OpenSolaris.

On Tue, Dec 27, 2005 at 01:15:39PM -0800, Tom Arthurs wrote:
> From http://docs.sun.com/source/817-1836-10/perfplat.html
> 
> High File System Page-in Rate
> 
> If you are seeing high file system page-in rates on Solaris 8 or 9, you 
> may benefit from increasing the value of segmap_percent. This parameter 
> is set by adding the following line to the /etc/system file:
> 
> set segmap_percent=25
> 
> segmap_percent adjusts the percentage of memory that the kernel will map 
> into its address space for the file system cache. The default value is 
> 12; that is, the kernel will reserve enough space to map at most 12% of 
> memory for the file system cache. On a heavily loaded machine with 4 GB 
> of physical memory, improvements have been seen with values as high as 
> 60. You should experiment with this value, starting with values around 
> 25. On systems with large amounts of physical memory, you should raise 
> this value in small increments, as it can significantly increase kernel 
> memory requirements.
> 
> 
> I think this can also be set with the kernel debugger.
> 
> I keep it at 50% on my E3500 and E4500 systems (8 and 12 GB memory).
> 
> Jim C. Nasby wrote:
> 
> >On Fri, Dec 23, 2005 at 04:50:32PM +1100, Dan Austin wrote:
> > 
> >
> >>>[...]
> >>>Right, the file is fully written under a temp name, and then 
> >>>rename()'d
> >>> 
> >>>
> >>This makes sense and is almost certainly not the cause of the problem.
> >>Although there is a lot more data being written to that file than I
> >>would have thought.
> >>
> >>One of Sun's kernel engineers has come up with a solution that seems to
> >>have fixed the problem. Instead of increasing work_mem (which we still
> >>might do) we've mounted a swapfs partition over the pg temp directory:
> >>
> >> # mount | grep pgsql_tmp
> >> /export/data/pgsql/data/base/64920741/pgsql_tmp on swap [...]
> >>
> >>This has actually reduced the disk activity considerably. So far, the
> >>blocking problem seems to have gone.
> >>
> >>Now to find some Postgres DBAs in Sydney to do some review / tuning of
> >>our memory settings. :-)
> >>   
> >>
> >
> >Note also that Solaris by default limits the amount of memory used for
> >disk caching, which is Not Good for PostgreSQL. IIRC this can be changed
> >with a sysctl, but I don't recall the details off-hand.
> > 
> >
> 
> 
> ---(end of broadcast)---
> TIP 3: Have you checked our extensive FAQ?
> 
>   http://www.postgresql.org/docs/faq
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [ADMIN] [GENERAL] Running with fsync=off

2005-12-27 Thread Jim C. Nasby
On Thu, Dec 22, 2005 at 11:47:13AM -0500, Tom Lane wrote:
> Martijn van Oosterhout  writes:
> > On Wed, Dec 21, 2005 at 11:30:15PM -0800, Benjamin Arai wrote:
> >> Somebody said running "sync ; sync; sync" from the console.  This seems
> 
> > The reason is partly historical. On some OSes running sync only starts
> > the process but returns immediatly. However, there can only be one sync
> > at a time so the second sync waits for the first the finish. The third
> > is just for show. However, on Linux at least the one sync is enough.
> 
> No, the second and third are both a waste of time.  sync tells the
> kernel to flush any dirty buffers to disk, but doesn't wait for it to
> happen.
> 
> There is a story that the advice to type sync twice was originally given
> to operators of an early Unix system, as a quick-and-dirty way of making
> sure that they didn't power the machine down before the sync completed.
> I don't know if it's true or not, but certainly the value would only
> appear if you type syncsync so that the first sync is
> actually issued before you type the next one.  Typing them all on one
> line as depicted is just a waste of finger motion.

How would syncsync differ from sync;sync? The second
case will wait for the first command to return, or is there a race
condition that's reduced by typing by hand?
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [ADMIN] [GENERAL] Running with fsync=off

2005-12-27 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> How would syncsync differ from sync;sync? The second
> case will wait for the first command to return, or is there a race
> condition that's reduced by typing by hand?

The actual runtime of the "sync" program is epsilon, because it doesn't
wait for all the I/O to happen.  The entire reason for the custom is
that the I/O is going on while you type the second "sync".  And yes,
it's a race condition.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [ADMIN] sending mail from Postgres

2005-12-27 Thread Aftab Alam
Hi Michael,

thanks for your reply.

you have mention that i can use plperlu, pltclu, or
plpython for sending mail, i am using windows version of postgres(7.3.1),

I have found that no dll in the postgres lib. for above mention language.

kindly suggest, form where i can find those language lib, & how can i
install those lib.

thanx & Regards,
aftab




7.3.1
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Michael Fuhr
Sent: Tuesday, December 27, 2005 11:11 PM
To: Aftab Alam
Cc: 'postgre'
Subject: Re: [ADMIN] sending mail from Postgres


On Tue, Dec 27, 2005 at 02:44:32PM +0530, Aftab Alam wrote:
> How can i send mail form postgresql.

You could write a function in a language like plperlu, pltclu, or
plpython, but a problem with functions that have effects outside
the database is that those effects can't be undone if the transaction
rolls back.  A common example is a trigger that sends email when a
table is changed: if the trigger fires and then you roll back the
transaction, it's too late to cancel the email.  Depending on what
you're doing it might be better to use LISTEN/NOTIFY and have a
client program send email when it receives a notification (notifications
are sent only when the transaction commits).

--
Michael Fuhr

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[ADMIN] Standby database & RAC concept in PostgresQL

2005-12-27 Thread Murugan G
Title: Standby database & RAC concept in PostgresQL






Hello,

Can I know whether Oracle's Standby database & RAC concepts available in PostgresQL


Thanks and regards,

G.Murugan,
Sr. Software Engineer.

Extn. 1658

===
Sobha Renaissance Information Technology Private Limited
An SEI-CMM & P-CMM Level 5 Company

World's 1st SSE-CMM Level 5 Company

BS 7799 certified by British Standards Institute

ISO 9001:2000 Certified by TÜV Rheinland/Berlin-Brandenburg

A Six Sigma Practice Company 

Tel: + 91 80 51951999; Fax: + 91 80 51523300; Video Conference: + 91 80 5125
Email : murugan.g@renaissance-it.com; Web: www.renaissance-it.com
===
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete all copies from any computer.