Re: [GENERAL] Using tables in other PostGreSQL database

2008-04-01 Thread Pettis, Barry
Wow seems like this post took on a life of it's own. All I wanted to do was to be able to use a table that someone else has all ready created. Seems like somewhere someone mentioned a DBA ( which I'm assuming to be Database Administrator ) well as far as I know we don't have one though I wish we

Re: [GENERAL] Installing support for python on windows

2008-04-01 Thread juan_carlos
Hello, I have the same problem. I've checked plpython.dll dependencies with depends tool and all is correct. I tried to install plperl with no success. What can I do? Magnus Hagander-2 wrote: On Tue, Feb 20, 2007 at 05:15:38PM -0500, Rhys Stewart wrote: resurrection Ok so i am having

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread Tomasz Ostrowski
On 2008-03-31 21:16, mark wrote: is the query I am running , and it takes over 10 seconds to complete this query... update users set number_recieved=number_recieved+1 where uid=738889333; Every time or only sometimes? If it is sometimes then I think this query is waiting for a checkpoint.

Re: [HACKERS] [GENERAL] ANALYZE getting dead tuple count hopelessly wrong

2008-04-01 Thread Pavan Deolasee
On Tue, Apr 1, 2008 at 1:22 AM, Tom Lane [EMAIL PROTECTED] wrote: Please do --- I have a lot of other stuff on my plate. Please see the attached patch. One change I made is to hold the SHARE lock on the page while ANALYZE is reading tuples from it. I thought it would be a right thing to do

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread mark
On Mon, Mar 31, 2008 at 11:18 PM, Tomasz Ostrowski [EMAIL PROTECTED] wrote: On 2008-03-31 21:16, mark wrote: is the query I am running , and it takes over 10 seconds to complete this query... update users set number_recieved=number_recieved+1 where uid=738889333; Every time or only

Re: [HACKERS] [GENERAL] ANALYZE getting dead tuple count hopelessly wrong

2008-04-01 Thread Simon Riggs
On Tue, 2008-04-01 at 13:07 +0530, Pavan Deolasee wrote: Please see the attached patch. One change I made is to hold the SHARE lock on the page while ANALYZE is reading tuples from it. I thought it would be a right thing to do instead of repeatedly acquiring/releasing the lock. ANALYZE is a

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread mark
On Tue, Apr 1, 2008 at 12:44 AM, mark [EMAIL PROTECTED] wrote: On Mon, Mar 31, 2008 at 11:18 PM, Tomasz Ostrowski [EMAIL PROTECTED] wrote: On 2008-03-31 21:16, mark wrote: is the query I am running , and it takes over 10 seconds to complete this query... update users set

Re: [GENERAL] Primary Key with serial the solution?

2008-04-01 Thread x asasaxax
How about if i do this inside a procedure: SELECT setval('sequence',(SELECT max(id) FROM table)) INTO variable; insert into table values(variable, ..., ...); ? Will this be transactional? Cause, they say that setval is a command that its transactional. Using this way i don´t will need to use a

Re: [GENERAL] minimum and maximum functions

2008-04-01 Thread josep porres
hh ok greatest()/least() 2008/4/1, josep porres [EMAIL PROTECTED]: I cannot find predefined functions to find minimum and maximum of at least two values. Aren't there any? select min(3,6) 3 select max(3,6) 6 Josep Porres

[GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
I made a similar question but maybe it was not that clear. I've a large table (items) linked with other tables (attributes). Some product ends into a basket. create table items( item_id serial primary key, attributes... ); create table item_attributes( item_id int references items

Re: [GENERAL] Using tables in other PostGreSQL database

2008-04-01 Thread Martijn van Oosterhout
On Mon, Mar 31, 2008 at 05:20:56AM -0600, Pettis, Barry wrote: I wish I could say that I knew with certainty what schemas are or 2PC is. Would be nice if I had exposure to other databases as well. I'm sure that I'd have the same questions about MSft's SQL server. Schemas are a subdivision

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread Tomasz Ostrowski
On 2008-04-01 09:44, mark wrote: I already am running 8.3.1 [ i mentioned in subject]. Missed that, sorry. I'd first try to set the following on a write-busy 8.3 server to smooth checkpoint spikes: checkpoint_segments = 16 checkpoint_timeout = 20min

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Apr 2008 12:01:21 +0200 Albe Laurenz [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo wrote: I've a bunch of functions that operates on the basket (a smaller list of products with their attributes). So many functions ends up in repeating over and over a select similar to:

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Albe Laurenz
Ivan Sergio Borgonovo wrote: I've a bunch of functions that operates on the basket (a smaller list of products with their attributes). So many functions ends up in repeating over and over a select similar to: select [list of columns] from baskets b join basket_items bi on

[GENERAL] minimum and maximum functions

2008-04-01 Thread josep porres
I cannot find predefined functions to find minimum and maximum of at least two values. Aren't there any? select min(3,6) 3 select max(3,6) 6 Josep Porres

[GENERAL] Role attribute for user email?

2008-04-01 Thread Philippe Lang
Hi, Is there a way to create new attributes for a login role, like an email attribute? I have to keep a few informations on all the users that connect to the PG server, and their attributes list looks like an elegant place to store these informations. But I cannot find a way to add new

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Albe Laurenz
Ivan Sergio Borgonovo wrote: I've a bunch of functions that operates on the basket (a smaller list of products with their attributes). So many functions ends up in repeating over and over a select similar to: select [list of columns] from baskets b join basket_items bi on

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread mark
On Tue, Apr 1, 2008 at 1:48 AM, Tomasz Ostrowski [EMAIL PROTECTED] wrote: On 2008-04-01 09:44, mark wrote: I already am running 8.3.1 [ i mentioned in subject]. But I have no experience on anything with more than 1GB of RAM... Should I reduce shared_buffers to less than 1GB? If that is

Re: [HACKERS] [GENERAL] ANALYZE getting dead tuple count hopelessly wrong

2008-04-01 Thread Stuart Brooks
Please do --- I have a lot of other stuff on my plate. Please see the attached patch. One change I made is to hold the SHARE lock on the page while ANALYZE is reading tuples from it. I thought it would be a right thing to do instead of repeatedly acquiring/releasing the lock. I have

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Apr 2008 14:00:39 +0200 Albe Laurenz [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo wrote: It doesn't look as I can do the same stuff with array and tables/records. Many times I use joint or aggregates on the basket. Sorry, my example was unclear. I was the first not to be

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread Tom Lane
Tomasz Ostrowski [EMAIL PROTECTED] writes: I'd also set log_checkpoints=on to get an idea how it behaves. Yeah, that's really the *first* thing to do. You need to determine whether the episodes of slowness are correlated with checkpoints or not; there's no point fooling with the

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Albe Laurenz
Ivan Sergio Borgonovo wrote: [wants to cache query results in a temporary table for use in several functions] yes... but it is not just a matter of caching the data but rather being able to exploit them with SQL. Oh, I see, you want to select/join with the cached data. Then neither arrays nor

Re: [GENERAL] Role attribute for user email?

2008-04-01 Thread korry
Is there a way to create new attributes for a login role, like an email attribute? I have to keep a few informations on all the users that connect to the PG server, and their attributes list looks like an elegant place to store these informations. But I cannot find a way to add new

Re: [GENERAL] Can Postgres 8.x start if some disks containing tablespaces are not mounted?

2008-04-01 Thread Morris Goldstein
On Mon, Mar 31, 2008 at 2:10 PM, Tom Lane [EMAIL PROTECTED] wrote: Morris Goldstein [EMAIL PROTECTED] writes: Suppose I have a database with $PGDATA on /dev/sda, and a tablespace directory on /dev/sdb. Will Postgres start successfully if /dev/sda is mounted and /dev/sdb is not? If not, why

Re: [HACKERS] [GENERAL] ANALYZE getting dead tuple count hopelessly wrong

2008-04-01 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: On Tue, 2008-04-01 at 10:22 -0400, Tom Lane wrote: In the fourth, if we actually believed this was a problem we'd need to redesign VACUUM too, as it does the same thing. VACUUM waits until nobody else has the buffer pinned, so lock contention is much

[GENERAL] optimiser STABLE vs. temp table was: HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Apr 2008 16:08:45 +0200 Albe Laurenz [EMAIL PROTECTED] wrote: [snip] Since you are looking for a sample, maybe something like that can get you started: CREATE SEQUENCE temp_names; [snip] I was thinking something in the line of it. I wasn't that sure of the course to follow. Just

Re: [HACKERS] [GENERAL] ANALYZE getting dead tuple count hopelessly wrong

2008-04-01 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: On Tue, 2008-04-01 at 13:07 +0530, Pavan Deolasee wrote: Please see the attached patch. One change I made is to hold the SHARE lock on the page while ANALYZE is reading tuples from it. I thought it would be a right thing to do instead of repeatedly

Re: [GENERAL] Using tables in other PostGreSQL database

2008-04-01 Thread Adrian Klaver
On Monday 31 March 2008 4:20 am, Pettis, Barry wrote: Wow seems like this post took on a life of it's own. All I wanted to do was to be able to use a table that someone else has all ready created. Seems like somewhere someone mentioned a DBA ( which I'm assuming to be Database Administrator )

Re: [HACKERS] [GENERAL] ANALYZE getting dead tuple count hopelessly wrong

2008-04-01 Thread Simon Riggs
On Tue, 2008-04-01 at 10:22 -0400, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: On Tue, 2008-04-01 at 13:07 +0530, Pavan Deolasee wrote: Please see the attached patch. One change I made is to hold the SHARE lock on the page while ANALYZE is reading tuples from it. I thought it

Re: [GENERAL] Using tables in other PostGreSQL database

2008-04-01 Thread Pettis, Barry
My bad. 1. I work at a Manufacturing plant. 2. We identify different process steps using numbers along with a short and long description 3. For a part we manufacture the system identifies SOME properties of said part. Things like nuper of process steps, part name, part family, and other

Re: [GENERAL] Using tables in other PostGreSQL database

2008-04-01 Thread Sam Mason
On Tue, Apr 01, 2008 at 09:12:54AM -0600, Pettis, Barry wrote: I guess the biggest problem is trying to describe something in terms that all can understand. On a forum like this most CONTRIBUTORS those who answer questions speak a language that the typical novice poster doesn't use or

[GENERAL] Getting weird pg_tblspc error, has anyone seen this before?

2008-04-01 Thread Tony Caduto
I have a client who is running this query(just brings back info about the databases on the server): select pgd.datname as database, pdesc.description, pgr.rolname as owner, pgt.spcname as tablespace, pg_size_pretty(pg_database_size(pgd.oid)) as dbsize, pg_encoding_to_char(encoding) as encoding,

Re: [GENERAL] optimiser STABLE vs. temp table was: HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Tom Lane
Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: I can't really appreciate the difference... or better... I think the difference may be that I can't take for granted the function will be cached if I delegate the choice to the optimiser. You can take for granted that it won't be, because there

Re: [GENERAL] optimiser STABLE vs. temp table was: HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Martijn van Oosterhout
On Tue, Apr 01, 2008 at 06:06:35PM +0200, Ivan Sergio Borgonovo wrote: Would you please be so kind to rephrase: http://www.postgresql.org/docs/8.1/interactive/xfunc-volatility.html snip I can't understand how it can call a function a single time and avoid to cache the result. Is it

Re: [GENERAL] optimiser STABLE vs. temp table was: HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
On Tue, 01 Apr 2008 11:22:20 -0400 Tom Lane [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: I can't really appreciate the difference... or better... I think the difference may be that I can't take for granted the function will be cached if I delegate the choice to

Re: [GENERAL] Getting weird pg_tblspc error, has anyone seen this before?

2008-04-01 Thread Tony Caduto
Tom Lane wrote: This must be coming from calculate_database_size(). Is $PGDATA/pg_tblspc actually missing? If the guy has no custom tablespaces, I can believe that nothing except pg_database_size() or pg_tablespace_size() would try to touch that subdirectory, so he might not otherwise notice

Re: [GENERAL] Using tables in other PostGreSQL database

2008-04-01 Thread Adrian Klaver
-- Original message -- From: Pettis, Barry [EMAIL PROTECTED] My bad. 1. I work at a Manufacturing plant. 2. We identify different process steps using numbers along with a short and long description 3. For a part we manufacture the system identifies

Re: [GENERAL] Getting weird pg_tblspc error, has anyone seen this before?

2008-04-01 Thread Tom Lane
Tony Caduto [EMAIL PROTECTED] writes: The exact error is(as reported from PG Admin III): ERROR: could not open tablespace directory pg_tblspc: No such file or directory This must be coming from calculate_database_size(). Is $PGDATA/pg_tblspc actually missing? If the guy has no custom

Re: [GENERAL] Getting weird pg_tblspc error, has anyone seen this before?

2008-04-01 Thread Magnus Hagander
Tony Caduto wrote: Tom Lane wrote: This must be coming from calculate_database_size(). Is $PGDATA/pg_tblspc actually missing? If the guy has no custom tablespaces, I can believe that nothing except pg_database_size() or pg_tablespace_size() would try to touch that subdirectory, so he might

Re: [GENERAL] Getting weird pg_tblspc error, has anyone seen this before?

2008-04-01 Thread Tony Caduto
Magnus Hagander wrote: Tony Caduto wrote: I will follow up with the client and have him check if that directory is missing. I think he may have used the Postbooks win32 installer to install his server, so it might be that their installer is messed up and not creating the directory properly or

[GENERAL] still on techniques to cache table slices was: optimiser STABLE vs. temp table

2008-04-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Apr 2008 18:32:25 +0200 Martijn van Oosterhout [EMAIL PROTECTED] wrote: On Tue, Apr 01, 2008 at 06:06:35PM +0200, Ivan Sergio Borgonovo wrote: Would you please be so kind to rephrase: http://www.postgresql.org/docs/8.1/interactive/xfunc-volatility.html snip I can't

[GENERAL] upgrading to 8.3, utf-8 and latin2 locale problem

2008-04-01 Thread Mage
Hello, I am sure this won't be the first e-mail about this issue, however we are upgrading production-like environment. Please help. For reproducing I've used two debian servers, same locales (en_US.UTF-8, en_US ISO-8859-1, hu_HU.UTF-8, hu_HU ISO-8859-2), Debian testing.

[GENERAL] Foreign keys causing conflicts leading to serialization failures

2008-04-01 Thread Peter Schuller
Hello, Using PostgreSQL 8.2, I have atable one of whose columns reference a column in othertable. I see serialization failures as a result of *inserts* to atable in the context of: 'SELECT 1 FROM ONLY othertable x WHERE otherid = $1 FOR SHARE OF x ' in 'INSERT INTO atable (otherid, col2,

Re: [GENERAL] upgrading to 8.3, utf-8 and latin2 locale problem

2008-04-01 Thread Tom Lane
Mage [EMAIL PROTECTED] writes: We would like to upgrade from 8.1 to 8.3. We have UTF-8 and LATIN2 databases. Any idea? If you were running with a non-C database locale, that was always broken in 8.1, and you are very fortunate not to have stumbled across any of the failure cases. You can

Re: [GENERAL] Getting weird pg_tblspc error, has anyone seen this before?

2008-04-01 Thread Tom Lane
Tony Caduto [EMAIL PROTECTED] writes: I just used the postbooks installer and it did not create the pg_tblspc directory, so the issue appears to be caused by a messed up Postbooks win32 installer. Check out this screenshot: http://www.milwaukeesoft.com/postbooks_datadir.png Bizarre. I

Re: [GENERAL] upgrading to 8.3, utf-8 and latin2 locale problem

2008-04-01 Thread Mage
Tom Lane wrote: Mage [EMAIL PROTECTED] writes: We would like to upgrade from 8.1 to 8.3. We have UTF-8 and LATIN2 databases. Any idea? If you were running with a non-C database locale, that was always broken in 8.1, and you are very fortunate not to have stumbled across any of the

Re: [GENERAL] Getting weird pg_tblspc error, has anyone seen this before?

2008-04-01 Thread Tony Caduto
Tom Lane wrote: Bizarre. I hope you'll tell them to fix that. Agreed :-) I bet they just took a snapshot of a install dir that had the postmaster stopped and used that in their setup. It probably does not do a initdb during the setup. Why it's missing that directory is a mystery :-)

[GENERAL] Logging of autovacuum activity

2008-04-01 Thread Markus Wollny
Hi, I am a bit stuck finding out how to log autovacuum activity in PostgreSQL 8.2. In the olden times I used to pipe the pg_autovacuum daemon's output to a file. Now pg_autovacuum has become part of the core, I wonder if there's some other possibility of monitoring its activity? I've got the

Re: [GENERAL] Logging of autovacuum activity

2008-04-01 Thread Simon Riggs
On Tue, 2008-04-01 at 21:02 +0200, Markus Wollny wrote: I am a bit stuck finding out how to log autovacuum activity in PostgreSQL 8.2. In the olden times I used to pipe the pg_autovacuum daemon's output to a file. Now pg_autovacuum has become part of the core, I wonder if there's some other

Re: [GENERAL] ANALYZE getting dead tuple count hopelessly wrong

2008-04-01 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Simon Riggs [EMAIL PROTECTED] writes: On Tue, 2008-04-01 at 13:07 +0530, Pavan Deolasee wrote: Please see the attached patch. One change I made is to hold the SHARE lock on the page while ANALYZE is reading tuples from it. I thought it would be a right

Re: [GENERAL] Logging of autovacuum activity

2008-04-01 Thread Ben
select schemaname,relname,last_autovacuum,last_autoanalyze from pg_stat_user_tables; ...should get you what you're after. On Tue, 1 Apr 2008, Markus Wollny wrote: Hi, I am a bit stuck finding out how to log autovacuum activity in PostgreSQL 8.2. In the olden times I used to pipe the

Re: [GENERAL] upgrading to 8.3, utf-8 and latin2 locale problem

2008-04-01 Thread Tom Lane
Mage [EMAIL PROTECTED] writes: What is the proper use of create database encoding = 'yyy' in postgresql 8.3? If you're not using C locale, it has no use whatsoever. If I understand You, I should avoid it totally, and convert every affected database dumps to UTF-8, load them and use

[GENERAL] anyone have experience with using Talend ETL tool

2008-04-01 Thread Irina Connelly
Hi, I am looking around for an ETL tool to transfer data from one Postgres database to another periodically. I was wondering if anyone has used Talend's Open Studio or any other ETL tools and wouldn't mind sharing their thoughts. Thanks, Irina -- Sent via pgsql-general mailing list

Re: [GENERAL] anyone have experience with using Talend ETL tool

2008-04-01 Thread Tomás Di Doménico
Irina Connelly wrote: Hi, I am looking around for an ETL tool to transfer data from one Postgres database to another periodically. I was wondering if anyone has used Talend's Open Studio or any other ETL tools and wouldn't mind sharing their thoughts. Thanks, Irina I've been using

Re: [GENERAL] anyone have experience with using Talend ETL tool

2008-04-01 Thread Dimitri Fontaine
Hi, Le Tuesday 01 April 2008 22:00:11 Irina Connelly, vous avez écrit : I am looking around for an ETL tool to transfer data from one Postgres database to another periodically. You could simply rely on COPY for this, as data coming out of PG could be trusted to be able to get in the other

[GENERAL] Connection reset by peer / broken pipe

2008-04-01 Thread Jeff Wigal (Referee Assistant)
Much the same as this person here: http://archives.postgresql.org/pgsql-general/2008-02/msg00689.php I am running Postgres 8.2.3 and am seeing the following error messages in my logs: LOG: SSL SYSCALL error: Connection reset by peer LOG: could not receive data from client: Connection reset by

Re: [GENERAL] Using tables in other PostGreSQL database

2008-04-01 Thread Daniel Verite
Pettis, Barry wrote: So yes I use multiple databases. ( 4 of which are ) 1. Lists all pats I manufacture ( includes general summary information like cycle time, number of process', number of critical process', number of metals used, etc... ) 2. Lists all process steps at my

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread mark
On Tue, Apr 1, 2008 at 7:27 AM, Tom Lane [EMAIL PROTECTED] wrote: Tomasz Ostrowski [EMAIL PROTECTED] writes: I'd also set log_checkpoints=on to get an idea how it behaves. Yeah, that's really the *first* thing to do. You need to determine I set this on, log_checkpoints = on and

[GENERAL] Too many commands in a transaction

2008-04-01 Thread sam
Hi ERROR: cannot have more than 2^32-1 commands in a transaction SQL state: 54000 Iam getting the above error when iam running my program. If iam not wrong this error ocuurs when there are too many statements executing in one single transaction. But this error is occuring in a function that iam

Re: [GENERAL] Connection reset by peer / broken pipe

2008-04-01 Thread Tom Lane
Jeff Wigal (Referee Assistant) [EMAIL PROTECTED] writes: I am running Postgres 8.2.3 and am seeing the following error messages in my logs: LOG: SSL SYSCALL error: Connection reset by peer LOG: could not receive data from client: Connection reset by peer LOG: unexpected EOF on client

Re: [GENERAL] Too many commands in a transaction

2008-04-01 Thread Tom Lane
sam [EMAIL PROTECTED] writes: ERROR: cannot have more than 2^32-1 commands in a transaction But this error is occuring in a function that iam least expecting it to occur in. If you haven't marked the function as read-only (IMMUTABLE or STABLE) then each statement in it counts as a command.

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread Tom Lane
mark [EMAIL PROTECTED] writes: I set this on, log_checkpoints = on and started postgres using this command pg_ctl -D /mnt/work/database -l /mnt/work/logs/pgsql.log start nothing is getting logged in the logfile. should I turn on some other settings? You're probably looking in the wrong

Re: [GENERAL] Connection reset by peer / broken pipe

2008-04-01 Thread Jeff Wigal (Referee Assistant)
That's possible. They are communicating with the server using MS Access, which is connecting to the server through the Postgres ODBC driver. On Tue, Apr 1, 2008 at 5:12 PM, Tom Lane [EMAIL PROTECTED] wrote: Jeff Wigal (Referee Assistant) [EMAIL PROTECTED] writes: I am running Postgres 8.2.3

[GENERAL] Update Join ?

2008-04-01 Thread kevin kempter
Hi List; Does Postgres allow updates based on the context of a sub-query, something like the sample below ? 1) Insert data (real_tab.keyID and real_tab.data_desc) into a temp table (temp_tab) 2) update real_tab set real_tab.data_desc = temp_tab.data_desc join real_tab on

Re: [GENERAL] Update Join ?

2008-04-01 Thread Adam Rich
Does Postgres allow updates based on the context of a sub-query, something like the sample below ? Yes, Update real_tab set real_tab.data_desc = temp_tab.data_desc From temp_tab Where real_tab.keyID = temp_tab.keyID (don't repeat your updated table in the from list unless you Mean to

[GENERAL] dblink ,dblink_exec not participating in a Transaction??

2008-04-01 Thread carty mc
How I can make dblink to participate in transaction so that remote changes made by dblink can only be committed if only local transaction succeds. Here is my current scenario: I am using two databases A B. In Database A, I have trigger procedure written for a Table . In this

[GENERAL] Primary Key with auto increment field

2008-04-01 Thread x asasaxax
I would like to increment one field, depending of the value of the other. here´s an example: id variable 1 1 2 1 1 2 2 2 can i do that with the following commands? SELECT setval('sequence',(SELECT max(id) FROM table)) INTO variable; insert into table values(variable,

Re: [GENERAL] dblink ,dblink_exec not participating in a Transaction??

2008-04-01 Thread carty mc
Just to clarify few things in the above posting. My Main DB Client is java (using hibernate) which has Main Transaction Manager. This one controls the overall transaction Work flow is as follows: 1)java program updates a table in Database A 2) As a result Trigger procedure defined for

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-01 Thread Greg Smith
On Tue, 1 Apr 2008, mark wrote: current settings all default #checkpoint_segments = 3 #checkpoint_timeout = 5min #checkpoint_completion_target = 0.5 #checkpoint_warning = 30s this is what I have on pg_stat_bgwriter ; how much should I increase checkpoint_segment checkpoint_completion_target

Re: [GENERAL] Can Postgres 8.x start if some disks containing tablespaces are not mounted?

2008-04-01 Thread Gurjeet Singh
On Tue, Apr 1, 2008 at 7:42 PM, Morris Goldstein [EMAIL PROTECTED] wrote: But that makes me wonder: what about this sequence of events: - Postgres running normally on /dev/sda and /dev/sdb. - Update to table in /dev/sdb tablespace is committed but still exists in WAL. - Postgres crashes

Re: [GENERAL] dblink ,dblink_exec not participating in a Transaction??

2008-04-01 Thread Douglas McNaught
On Tue, Apr 1, 2008 at 7:56 PM, carty mc [EMAIL PROTECTED] wrote: In this case the updates that were made using dblink_exec are not getting rolled back in Database B. And they won't be. dblink isn't transactional in that way. Your best bet is to put all the data into one database and use

Re: [GENERAL] Primary Key with serial the solution?

2008-04-01 Thread Craig Ringer
x asasaxax wrote: How about if i do this inside a procedure: SELECT setval('sequence',(SELECT max(id) FROM table)) INTO variable; insert into table values(variable, ..., ...); ? Will this be transactional? Cause, they say that setval is a command that its transactional. Using this way i

Re: [GENERAL] Primary Key with auto increment field

2008-04-01 Thread Craig Ringer
x asasaxax wrote: I would like to increment one field, depending of the value of the other. here´s an example: Didn't you just ask this question with practically the same wording a few days ago? What was wrong with the answers then? What has changed? What's the *difference* this time?