Re: [GENERAL] about c# and postgresql

2007-07-23 Thread Bryan Murphy
I highly recommend you use the Npgsql driver, and if you're feeling really saucy try NHibernate on top of that. http://pgfoundry.org/projects/npgsql http://www.nhibernate.org/ Bryan On 7/23/07, longlong <[EMAIL PROTECTED]> wrote: hi,all i have a local system with windows xp. i want to use c#

[GENERAL] about c# and postgresql

2007-07-23 Thread longlong
hi,all i have a local system with windows xp. i want to use c# to connect with a postgresql database running in a linux system. i get libpg.dll and PgOleDb.dll. that's enough for me to do so? or could you tell me how?

Re: [GENERAL] Delete/update with limit

2007-07-23 Thread Simon Riggs
On Mon, 2007-07-23 at 17:56 +0200, Csaba Nagy wrote: > Now I don't put too much hope I can convince anybody that the limit on > the delete/update commands has valid usage scenarios, but then can > anybody help me find a good solution to chunk-wise process such a buffer > table where insert speed i

Re: [HACKERS] [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-23 Thread Sibte Abbas
On 7/23/07, Tom Lane <[EMAIL PROTECTED]> wrote: No, the place that has to change is where errstart() detects that we're recursing. We could possibly have it first try to make a shorter string and only give up entirely if recursion happens again, but given that this is such a corner case I don't

Re: [GENERAL] Delete/update with limit

2007-07-23 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/23/07 10:56, Csaba Nagy wrote: > Hi all, > > This subject was touched a few times in the past, I looked into the > archives... the result is invariably key developers saying such a > feature is unsafe because the result is unpredictable, while t

Re: [GENERAL] two phase commit

2007-07-23 Thread Andrew Sullivan
On Mon, Jul 23, 2007 at 12:29:06PM -0700, Jeff Davis wrote: > The way you worded your reply would scare anyone away from using 2PC at > all, and 2PC might be useful in Ben's case. Well, I didn't intend to scare anyone away from it! Apologies. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole

Re: [GENERAL] two phase commit

2007-07-23 Thread Jeff Davis
On Mon, 2007-07-23 at 14:48 -0400, Andrew Sullivan wrote: > Right. But there's a big difference between this case and many > catastrophic problems, because it's entirely possible that the whole > reason you were using 2PC was to increase reliability in the face of > various disasters, including op

Re: [GENERAL] two phase commit

2007-07-23 Thread Andrew Sullivan
On Mon, Jul 23, 2007 at 11:59:39AM -0700, Ben wrote: > Good point, but just to be clear, I was asking about 2PC because our app > writes to two different databases, and the authors never considered that > the second commit might fail. Ok, so as long as you're willing to accept that "second commi

Re: [GENERAL] query optimizer

2007-07-23 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> On Thu, Jul 19, 2007 at 10:41:03AM -0400, Tom Lane wrote: >>> The developers section of the website used to have slides from a couple >>> of talks I gave at OSCON, but I don't see them there anymore :-( > >> How long ago was this (th

Re: [GENERAL] Delete/update with limit

2007-07-23 Thread Chris Browne
[EMAIL PROTECTED] (Csaba Nagy) writes: > In postgres we're currently not chunking, due to the fact that the code > to do it is simply overly contorted and inefficient compared to the > other DBs we use. At least all the solutions we could think of to do the > chunking in a safe way while the insert

Re: [GENERAL] two phase commit

2007-07-23 Thread Ben
Good point, but just to be clear, I was asking about 2PC because our app writes to two different databases, and the authors never considered that the second commit might fail. On Mon, 23 Jul 2007, Andrew Sullivan wrote: On Fri, Jul 20, 2007 at 05:17:00PM -0700, Jeff Davis wrote: On Fri, 2007

Re: [GENERAL] Using COALESCE nside function

2007-07-23 Thread Michael Glaesemann
On Jul 23, 2007, at 12:58 , Robert Fitzpatrick wrote: Is it possible to use COALESCE function inside a function as a cursor variable? test cursor (myvar varchar) for (coalesce(SELECT...,0)); I get a syntax error when trying this...ERROR: syntax error at or near "COALESCE"...is t

Re: [GENERAL] Using COALESCE nside function

2007-07-23 Thread A. Kretschmer
am Mon, dem 23.07.2007, um 13:58:22 -0400 mailte Robert Fitzpatrick folgendes: > Is it possible to use COALESCE function inside a function as a cursor > variable? Yes, why not? > > test cursor (myvar varchar) for > (coalesce(SELECT...,0)); I guess: wrong syntax. Try instead select co

Re: [GENERAL] two phase commit

2007-07-23 Thread Andrew Sullivan
On Fri, Jul 20, 2007 at 05:17:00PM -0700, Jeff Davis wrote: > On Fri, 2007-07-20 at 15:26 -0400, Andrew Sullivan wrote: > > instance, recently it turned out that there was a way, using 2PC, to > > lock everybody out of the database. The only remedy to that at the > > moment is to blow away all the

[GENERAL] Using COALESCE nside function

2007-07-23 Thread Robert Fitzpatrick
Is it possible to use COALESCE function inside a function as a cursor variable? test cursor (myvar varchar) for (coalesce(SELECT...,0)); I get a syntax error when trying this...ERROR: syntax error at or near "COALESCE"...is there a way to do this? -- Robert

Re: [HACKERS] [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-23 Thread Tom Lane
"Sibte Abbas" <[EMAIL PROTECTED]> writes: > I think printing the first 1K would make more sense. > If I understand you correctly, the code path which you are referring > to is the send_message_to_server_log() function in elog.c? No, the place that has to change is where errstart() detects that we

[GENERAL] Should SERIAL column have MAXVAL set on sequence

2007-07-23 Thread Woody Woodring
I have a table in our DB that functions as a queue with a SERIAL column for its primary key. At 4am this weekend I started getting the error: ERROR: integer out of range Which was attributed to the sequence incrementing past the size of the int4 serial column after several years of operation.

[GENERAL] Delete/update with limit

2007-07-23 Thread Csaba Nagy
Hi all, This subject was touched a few times in the past, I looked into the archives... the result is invariably key developers saying such a feature is unsafe because the result is unpredictable, while the people requesting is saying it is OK that way, it is expected... but no compelling use case

Re: [GENERAL] Import to excel to postgres based website?

2007-07-23 Thread Steve Atkins
On Jul 22, 2007, at 11:26 PM, novnov wrote: The answer may or many not be very postgres specific but...what are some possible routes that I could take to allows users to upload data from excel into a postgres via a website? I've never tried anything like this before. Are there standard

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Scott Marlowe
On 7/23/07, Chuck Payne <[EMAIL PROTECTED]> wrote: Hey, I have spend the last several days looking for a website or how to that would show me how to call postgresql in bash script. I know that in mysql I can do like this for i in `cat myfile.txt` ; do mysql -uxxx -p -Asse mydatabase "inse

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Raymond O'Donnell
On 23/07/2007 14:51, Perry Smith wrote: Ah... I knew that. I always assume it does, then it doesn't work, then I look at the man page. Sorry. Been there, still wearing the t-shirt! :-) Ray. --- Raymond O'Donnell, Director of Mus

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Perry Smith
On Jul 23, 2007, at 8:32 AM, Raymond O'Donnell wrote: On 23/07/2007 14:22, Perry Smith wrote: First, you can specify a password with -P (I think --password works also). psql --help for optins. -P doesn't specify the password - see below: C:\Documents and Settings\rod>psql --help This is p

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Raymond O'Donnell
On 23/07/2007 14:22, Perry Smith wrote: First, you can specify a password with -P (I think --password works also). psql --help for optins. -P doesn't specify the password - see below: C:\Documents and Settings\rod>psql --help This is psql 8.2.4, the PostgreSQL interactive terminal. Usage:

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Perry Smith
First, you can specify a password with -P (I think --password works also). psql --help for optins. Usually the DB defaults to trusting everything local (if I'm not mistaken -- someone please correct me if I'm over simplifying). As far as getting your data into the database, I would look at

Re: [GENERAL] Retrieve the record ID

2007-07-23 Thread Luca Ciciriello
Yes, I've used RAISE NOTICE, but I'm unable to catch it in my code. I've used PQsetNoticeProcessor to set my callback function but doesn't seem to work. In My application I'm unable to catch the notice launched by the trigger. Wich function I have to use in my application in order to catch the

Re: {Spam} [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Dimitri Fontaine
Hi, Le lundi 23 juillet 2007, Chuck Payne a écrit : > for i in `cat > myfile.txt` ; do mysql -uxxx -p -Asse mydatabase  "insert > into mytable  (aaa,bbb) values ("xxx", > "yyy");" It seems a part of your problem is not about scripting psql but loading data into PostgreSQL, so let me present

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Pavel Stehule
Hello I don't understand well, what you want to do. You can cat myfile.txt | psql database or like your sample for i in `cat myfile.txt` ; do psql mydatabase -c "insert into mytable (aaa,bbb) values ("xxx", "yyy");" ... regards Pavel Stehule 2007/7/23, Chuck Payne <[EMAIL PROTECTED]>:

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Raymond O'Donnell
On 23/07/2007 11:04, Andy Dale wrote: The posgres command in the loop should look like so (not sure about the password): As I understand it, you supply the password via a pgpass file - you can't include it on the command line. Ray. --

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Ow Mun Heng
On Mon, 2007-07-23 at 05:34 -0400, Chuck Payne wrote: > > Hey, > > I have spend the last several days looking for a website or how to > that would show me how to call postgresql in bash script. I know that > in mysql I can do like this > > for i in `cat myfile.txt` ; do mysql -uxxx -p -Ass

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Andy Dale
Hi Chuck, I am no expert but this should definitely be possible with postgres. The posgres command in the loop should look like so (not sure about the password): psql -U -d mydatabase -c ""insert into mytable (aaa,bbb) values ('xxx', 'yyy');" Cheers, Andy On 23/07/07, Chuck Payne <[EMAIL P

[GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Chuck Payne
Hey, I have spend the last several days looking for a website or how to that would show me how to call postgresql in bash script. I know that in mysql I can do like this for i in `cat myfile.txt` ; do mysql -uxxx -p -Asse mydatabase  "insert into mytable  (aaa,bbb) values ("xxx", "yyy");

Re: [GENERAL] Import to excel to postgres based website?

2007-07-23 Thread Richard Huxton
novnov wrote: The answer may or many not be very postgres specific but...what are some possible routes that I could take to allows users to upload data from excel into a postgres via a website? I've never tried anything like this before. Are there standard modules that might help with this or wil

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-23 Thread Dawid Kuroczko
On 7/22/07, Vincenzo Romano <[EMAIL PROTECTED]> wrote: On Sunday 22 July 2007 19:20:08 Tom Lane wrote: > Vincenzo Romano <[EMAIL PROTECTED]> writes: > > In the original setup, the "UNIQUE" constraint had been dropped > > *before* doing the tests. So the "slow" case is without the > > UNIQUE const