Re: [GENERAL] Tracking down deadlocks

2004-06-17 Thread Csaba Nagy
deadlock, but > >> nothing says doing that actually eliminates the chance. > >> Is this just a known limitation? In this particular instance, I > >> probably could get rid of my foreign keys and if things go bad it > >> wouldn't hurt anything.... but I m

Re: [GENERAL] simultaneous use of JDBC and libpq

2004-06-23 Thread Csaba Nagy
Yes, it is safe. The JDBC and the libpq app will share nothing between each other, so there can not be any threading issues between them. You can only have thread safety issues inside the same application which uses multiple threads sharing resources between each other. Cheers, Csaba. On Wed, 200

Re: [GENERAL] Trigger on Postgres for tables syncronization

2004-07-27 Thread Csaba Nagy
Prabu, You should use views for appointment0 and appointment1. That way when you insert/modify in appointment, the modifications will automatically show up in the views too. See also http://www.postgresql.org/docs/7.4/static/sql-createview.html on how to create a view. Cheers, Csaba. On Tue, 20

Re: [GENERAL] I have some questions...

2004-08-02 Thread Csaba Nagy
Prabu, There are a number of approaches to do this: 1) Store your images on the file system of the server and in the data base store only the path to it; 2) Create an icon table, and store your icons as BLOBs in it, then reference them from your reports table. I'm not an expert on BLOBs, so ple

Re: [GENERAL] Thousands of parallel connections

2004-08-16 Thread Csaba Nagy
Hi guys, Peter is definitely not a newby on this list, so i'm sure he already thought about some kind of pooling if applicable... but then I'm dead-curious what kind of application could possibly rule out connection pooling even if it means so many open connections ? Please give us some light Pete

Re: [GENERAL] Thousands of parallel connections

2004-08-16 Thread Csaba Nagy
[snip] > requests, it only saves connection start effort. (You could make the > connection pool server queue the requests, but that is not the point of this > exercise.) I didn't quite consider the RAM question, but the machine is [snip] Well, I would disagree here. If the connections are not

Re: [GENERAL] view triggers/procedures

2004-08-23 Thread Csaba Nagy
Raju, these triggers are the PG implementation of foreign key constraints checking. They are written in C, so if you're curios how they work you will have to check the postgres sources ;-) HTH, Csaba. On Mon, 2004-08-23 at 12:06, SVGK, Raju (Raju) wrote: > Hi, > > I have a table where in lot

Re: [GENERAL] view triggers/procedures

2004-08-23 Thread Csaba Nagy
a, > Thank you for your reply. How do I check the sources. Can you please tell me > in detail. > regds > -raju > > > -Original Message- > From: Csaba Nagy [mailto:[EMAIL PROTECTED] > Sent: Monday, August 23, 2004 4:11 PM > To: SVGK, Raju (Raju) > Cc: '[E

Re: [GENERAL] Unsupported 3rd-party solutions (Was: Few questions

2004-08-23 Thread Csaba Nagy
Hi all, Bruce, if postgres is not a company and so on, why don't you open up the core development team to include some of the contributors who would like to include their product in the main distribution, and have a bundled product ? Cause a good data base is definitely not made up just by the cor

Re: [GENERAL] Best practices for migrating a development database

2004-09-13 Thread Csaba Nagy
Beside version controlled schema files we have a guy who writes migration scripts based on the old schema and the new (development) schema (frozen e.g. by branching in CVS). Usually there are 3 steps involved: - a pre-migration script, which prepares the data base for the new schema, by adding the

Re: [GENERAL] Default value if query returns 0 rows?

2004-09-17 Thread Csaba Nagy
[snip] > Another way is a subselect: > > select coalesce((select id from map where name = 'foo'), -1); Then why not: select coalesce((select id from map where name = 'foo' limit 1), -1); This should work even if there are more rows with foo. > > but this one will actively blow up if the

Re: [GENERAL] Message-ID as unique key?

2004-10-12 Thread Csaba Nagy
No, it's not a global unique identifier. In fact you cannot even be sure it will always be there in all mails, depending on your mail processing chain. Most of the email clients will add one, and most of the mail transfer agents will also add one if missing, but there's no general rule of how to cr

Re: [GENERAL] Message-ID as unique key?

2004-10-12 Thread Csaba Nagy
On Tue, 2004-10-12 at 17:11, Csaba Nagy wrote: > No, it's not a global unique identifier. [snip] Hey, you know what ? Good that I read this thread :D I'm in the process of writing a Java SMTP server, and had no clue about this rule... although I have read a few times the relevant R

Re: [GENERAL] Mailing

2004-10-05 Thread Csaba Nagy
I would thought it would be an obvious try: cnagy=> select to_char(now(), 'HH:MM AM'); to_char -- 04:10 PM (1 row) HTH, Csaba. On Tue, 2004-10-05 at 16:32, Todd P Marek wrote: > Hello- > > I am in the process of translating a site using mysql as the > backendover to postgres. I hav

Re: [GENERAL] Mailing

2004-10-05 Thread Csaba Nagy
Hey, I didn't know "trim" is so flexible... cool ! Cheers, Csaba. On Tue, 2004-10-05 at 17:00, Kevin Barnard wrote: > SELECT trim(leading '0' from to_char(now(), 'HH:MM AM')) > > I think is what you really want. This gets rid of the nasty leasing 0. > > ---(end of broa

Re: [GENERAL] Making pgsql error messages more developers' friendly.

2003-06-30 Thread Csaba Nagy
What about development time ? It is always nice to have the database give you some actually useful pointers instead of making you loose your time chasing around the error in your code. We are all just humans, do mistakes, and do like when the mistake is easily spotted by an error message pointing t

Re: Fw: [GENERAL] select null + 0 question

2003-07-14 Thread Csaba Nagy
This was executed via sql+ on an Oracle 9i installation: SQL> select 1 from dual where 1 in (1,2,null); 1 -- 1 SQL> select 1 from dual where 1 in (null); no rows selected I would say the Oracle implementation is correct and the same as in Postgres. For your problem I

Re: [GENERAL] different transaction handling between postgresql and

2003-07-14 Thread Csaba Nagy
Oracle does not roll back any transaction unless explicitly requested by the client application. If there are errors while executing statements inside a transaction, their effect is rolled back, not the whole transaction. The application can then decide if the successful part of the transaction is

Re: [GENERAL] different transaction handling between postgresql and

2003-07-14 Thread Csaba Nagy
On Mon, 2003-07-14 at 10:43, Peter Childs wrote: > On Mon, 14 Jul 2003, Mike Mascari wrote: > > > Jörg Schulz wrote: > > > > >>... I have this feeling the reason Oracle gives this result may > > >>be again because transactions have been switched off! > > > > > > This snippet comes from the Oracl

Re: [GENERAL] different transaction handling between postgresql and

2003-07-14 Thread Csaba Nagy
This has been discussed for many times on this list, but shortly: when inserting a new row, there's no previous row to select for update. If you have 2 concurrent transactions, both of them can execute the select for update at the same time, select nothing, and then try to insert the same key, and

Re: [GENERAL] Scheduled back up

2003-07-18 Thread Csaba Nagy
On Fri, 2003-07-18 at 15:49, Viorel Dragomir wrote: > > No, .pgpass is sought in the home directory of the user running pg_dump > > (or any other client program). It's not a server-side file. > > In my case the user is apache. > I dunno for sure but the apache doesn't have a home directory. > If

Re: [GENERAL] using EXISTS instead of IN: how?

2003-07-22 Thread Csaba Nagy
You should use something like: SELECT name FROM people p WHERE exists ( SELECT 1 FROM states WHERE name = p.state ) AND state ~* 'r'; On Tue, 2003-0

Re: [GENERAL] using EXISTS instead of IN: how?

2003-07-22 Thread Csaba Nagy
Actually, even better: select name from people p, states s where p.state = s.name and p.state ~* 'r'; Cheers, Csaba. On Tue, 2003-07-22 at 18:36, Csaba Nagy wrote: > You should use something like: > > SELECT > name > FROM > people p &g

Re: [GENERAL] Updating from update trigger

2003-07-31 Thread Csaba Nagy
You should probably rethink the application logic. If there's no way to do it differently, you might be able to place the location details in a separate table, and update them there - this way on update of the "cd" table you will update also the "cd_locations" table, avoiding the loop. You should

Re: [GENERAL] Updating from update trigger

2003-07-31 Thread Csaba Nagy
some query rewriting rules. I have absolutely no experience with this, so check out the docs: http://www.postgresql.org/docs/7.3/static/rules.html HTH, Csaba. On Thu, 2003-07-31 at 14:26, Csaba Nagy wrote: > You should probably rethink the application logic. > If there's no way to do it diff

Re: [GENERAL] pgplsql - Oracle nvl

2003-08-28 Thread Csaba Nagy
You don't need to build any function for this, you have them ready: http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=functions-conditional.html#AEN9753 http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=functions-conditional.html#AEN9698 Cheers, Csaba. On Wed, 2003-08-

Re: [GENERAL] Replaceing records

2003-09-04 Thread Csaba Nagy
[philosophical post regarding a missing feature of Postgres] Hi all, This is exactly the problem I'm facing right now, and I found there's no good solution to this in postgres. Basically I have a complex database operation, which spans a transaction across multiple simple DB operations which can

Re: [GENERAL] Replaceing records

2003-09-04 Thread Csaba Nagy
On Thu, 2003-09-04 at 15:52, Greg Stark wrote: > > Csaba Nagy <[EMAIL PROTECTED]> writes: > > > This problem would be easily solved if the current transaction would not > > be automatically rolled back on the failed insert. Given this, it would > > be as easy a

Re: [GENERAL] Very strange selectproblem

2003-11-04 Thread Csaba Nagy
See my comments below. On Tue, 2003-11-04 at 13:10, Victor SpÃng Arthursson wrote: > Can't select 3 columns from a table called varer. > > The columns are the three first and are called vnummer, puNr and dNr. > > The error message is: > > indiadan=# select varer.vNummer from varer;

Re: [GENERAL] Constraint Problem

2003-11-05 Thread Csaba Nagy
You probably didn't quite understand the suggestion. You should create a unique index like: create unique index your_index_name on your_table (companyID, associationID) where ysnDefault; This will restrict the uniqueness checks to the records where ysnDefault is true (and not null, of course). H

Re: [GENERAL] select/update performance?

2003-11-05 Thread Csaba Nagy
You are buying yourself trouble. The holes in the IDs are the least problem, and a generated sequence should not have any business meaning anyway. BTW, what happens when you delete a record ? That would surely leave you a hole in the IDs... Just a quick thought: if you are going to handle manually

<    1   2   3   4