Re: [GENERAL] table locking and SELECT FOR UPDATE

2005-07-11 Thread Joseph Shraibman
The situation I have is that there are some records in a table that need to be updated, some of which don't exist and need to be created. So I start a transaction and do a SELECT FOR UPDATE to lock the existing rows and LOCK TABLE IN SHARE MODE to keep inserts from happening. The problem is t

Re: [GENERAL] Quoting $user as Parameter to SET

2005-07-11 Thread Thomas F. O'Connell
Uh... Just kidding, I guess. Wish I had a screen capture of what I had done before because I swear I was unable to create a table in the user namespace after having created it. But now that I look more closely (including when running current_schemas(true)), everything looks fine. Sorry fo

Re: [GENERAL] Quoting $user as Parameter to SET

2005-07-11 Thread Tom Lane
"Thomas F. O'Connell" <[EMAIL PROTECTED]> writes: > This is an important distinction because testing reveals that the > quoted $user after the reversal is no longer actually a dynamic > variable that results in a search_path that resolves to the current > user. Really? It works fine for me: re

Re: [GENERAL] table locking and SELECT FOR UPDATE

2005-07-11 Thread Tom Lane
Joseph Shraibman writes: > How come when a share lock is held and update can't be done on the > table, but a SELECT FOR UPDATE can be done? I can't SELECT FOR UPDATE > the same row in two transactions, but I can SELECT FOR UPDATE a row that > I will won't be able to update because the other ta

[GENERAL] Quoting $user as Parameter to SET

2005-07-11 Thread Thomas F. O'Connell
The default search_path is $user, public.Say I wanted to reverse this in a database called d:First of all:d=> show search_path; search_path-- $user,public(1 row)Then:d=> alter database d set search_path to public, '$user';Then, in a new session:d=> show search_path; search_path-

[GENERAL] table locking and SELECT FOR UPDATE

2005-07-11 Thread Joseph Shraibman
How come when a share lock is held and update can't be done on the table, but a SELECT FOR UPDATE can be done? I can't SELECT FOR UPDATE the same row in two transactions, but I can SELECT FOR UPDATE a row that I will won't be able to update because the other table is held in a SHARE lock. -

Re: [GENERAL] PostgreSQL Scalability

2005-07-11 Thread Vivek Khera
On Jul 8, 2005, at 9:52 AM, [EMAIL PROTECTED] wrote: I am trying to get information about the Scalability options available for PostgreSQL. Assuming you a database that has a huge volume of reads and writes happening, what options have you got to scale your database. Many commercial RDBMS'

Re: [GENERAL] A trigger that acts on a column with a given column

2005-07-11 Thread Karl O. Pinc
On 07/07/2005 02:28:23 PM, BigSmoke wrote: In a trigger function, I'm trying to refer to a column given by an argument to the trigger function. I sometimes have a tendency to use the m4 macro processor to write different trigger functions with the correct column name substituted in where appro

Re: [GENERAL] strange problem with pl/pgsql function caching of bad values

2005-07-11 Thread snacktime
> > One other thing about our particular setup is that we use separate > > schema's for all user data and the functions go in the public schema. > > So before executing this function we issue something like 'set_path to > > username,public'. > > Mph. Are you expecting the function to work for mor

[GENERAL] Db and schema names in logged errors

2005-07-11 Thread Karl O. Pinc
Is there any way to get the DB and schema name into error messages, particularly when the errors are logged? I'd like to be able to distinguish errors coming from the test databases from those coming from the live databases. Thanks. Karl <[EMAIL PROTECTED]> Free Software: "You don't pay back,

Re: [GENERAL] PostgreSQL Hosting

2005-07-11 Thread Thomas F. O'Connell
I don't really think it's that bad (if it proves to work): 1. A simple modification to system_views.sql 2. Modified schema search path: public, pg_catalog, $user 3. New public views: pg_database, pg_group If the final two pieces work, we won't even need to modify phpPgAdmin. Anyway, thanks for

Re: [GENERAL] strange problem with pl/pgsql function caching of bad values

2005-07-11 Thread Tom Lane
snacktime <[EMAIL PROTECTED]> writes: > I have a very strange issue that I'm not sure how to debug. Hm, are you certain there is always only one row for each value of s_oid? This command: > status := active from recurbilling_transactions where s_oid = in_s_oid; is going to give you a random one

[GENERAL] {Virus?} *DETECTED* Online User Violation

2005-07-11 Thread webmaster
Prot: email-info.zip->email-info.doc Infection: W32/[EMAIL PROTECTED] Note to Help Desk: Look on the MailScanner in /var/spool/MailScanner/quarantine/20050711 (message j6BI0LuM011683). -- Postmaster MailScanner thanks transtec Comp

Re: [GENERAL] upgrading from 8.0 rc5

2005-07-11 Thread Tom Lane
snacktime <[EMAIL PROTECTED]> writes: > Do I need to do a full dump/restore when migrating from 8.0 rc5 to the > latest 8.0.3? No. When in doubt, the authoritative reference for this sort of question is the revision history for catversion.h: http://developer.postgresql.org/cvsweb.cgi/pgsql/src/i

Re: [GENERAL] PostgreSQL Hosting

2005-07-11 Thread Joshua D. Drake
Thomas F. O'Connell wrote: Joshua, Is there any difference between a catalog and a cluster? As in, are you saying a separate postmaster per user, as Tom Lane suggested in the post I referenced earlier in this thread? No difference. Yes as Tom Lane suggested. It also helps with migration. I

Re: [GENERAL] upgrading from 8.0 rc5

2005-07-11 Thread Michael Fuhr
On Mon, Jul 11, 2005 at 10:58:00AM -0700, snacktime wrote: > Do I need to do a full dump/restore when migrating from 8.0 rc5 to the > latest 8.0.3? Check the revision history of catversion.h to see if the catalog version changed between 8.0.0rc5 and 8.0.3: http://developer.postgresql.org/cvsweb.c

Re: [GENERAL] PostgreSQL Hosting

2005-07-11 Thread Thomas F. O'Connell
Joshua, Is there any difference between a catalog and a cluster? As in, are you saying a separate postmaster per user, as Tom Lane suggested in the post I referenced earlier in this thread? Off-hand, do you (or anyone else) see any showstoppers with the implementation I laid out involving

[GENERAL] upgrading from 8.0 rc5

2005-07-11 Thread snacktime
Do I need to do a full dump/restore when migrating from 8.0 rc5 to the latest 8.0.3? Chris ---(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 d

[GENERAL] strange problem with pl/pgsql function caching of bad values

2005-07-11 Thread snacktime
I have a very strange issue that I'm not sure how to debug. This is on postgresql 8.0.0rc5, Freebsd 5.4. Yes I know I should be upgrading this version and it's scheduled, but it can't happen for another week and for all I know this might still be an issue in current versions of postgresql. First

Re: [GENERAL] Data type to store latitude and longitude

2005-07-11 Thread Tom Lane
MaRCeLO PeReiRA <[EMAIL PROTECTED]> writes: > Is there a data type to store data extracted from a > GPS? The only thing I need is store latitude and > longitude. You might be interested in postgis http://www.postgis.org/ regards, tom lane ---(end o

Re: [GENERAL] max_prepared_connections

2005-07-11 Thread Alvaro Herrera
On Mon, Jul 11, 2005 at 09:50:27AM -0700, Joshua D. Drake wrote: > I have RTFM on max_prepared_connections but I need more info. What is > the prepared transaction for? Is it a part of 2PC? Yes. A prepared transaction is one that has passed "first phase commit" and is waiting for the second pha

[GENERAL] {Virus?} Rbgbqsvkmzwndu

2005-07-11 Thread webmaster
F-Prot: document.zip->document.doc Infection: W32/[EMAIL PROTECTED] Note to Help Desk: Look on the MailScanner in /var/spool/MailScanner/quarantine/20050711 (message j6BGbnuM032547). -- Postmaster MailScanner thanks transtec Comp

Re: [GENERAL] PostgreSQL Hosting

2005-07-11 Thread Joshua D. Drake
Although it is resource intensive, Command Prompt creates a new catalog owned by the user for each account. So on a given machine we will have 25 postgresql catalogs running on separate ports. This has worked very well for us for the last couple of years. Sincerely, Joshua D. Drake -- Your P

Re: [GENERAL] PostgreSQL Hosting

2005-07-11 Thread Thomas F. O'Connell
In my haste, I neglected to update the name of this view in my post to pg_database from its original definition as pg_db, which was the original name of the hacked view.The point is that we want pg_catalog.pg_database to be superseded by public.pg_database from the point of view of both the user an

[GENERAL] max_prepared_connections

2005-07-11 Thread Joshua D. Drake
Hello, I have RTFM on max_prepared_connections but I need more info. What is the prepared transaction for? Is it a part of 2PC? Sincerely, Joshua D. Drake -- Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240 PostgreSQL Replication, Consulting, Custom Programming, 24x7 s

Re: [GENERAL] PostgreSQL Hosting

2005-07-11 Thread Thomas F. O'Connell
Okay, after setting up a hosting environment based on my original post, we immediately discovered a few caveats. One is that, as written, pg_user creates issues with pg_dump because a given user needs access to various system catalogs and postgres must exist in pg_user, so we updated the view. Seco

[GENERAL] Data type to store latitude and longitude

2005-07-11 Thread MaRCeLO PeReiRA
Hi guys, Is there a data type to store data extracted from a GPS? The only thing I need is store latitude and longitude. Thanks in advance, Regards, Marcelo P Campinas/SP/Brazil ___ Yahoo! Acesso Grátis -

Re: [GENERAL] PG 8.0.3 ignores parameter listen_addresses ?

2005-07-11 Thread Tom Lane
Andreas <[EMAIL PROTECTED]> writes: > Now, to embarass me a bit further, I'd need to ask why netstat now > (still) shows : > tcp0 0 ::1:5432:::*LISTEN > That's probaply some IP V6 thingy. Yup, that's the IPv6 spelling of localhost. > I didn't fee

Re: [GENERAL] PG 8.0.3 ignores parameter listen_addresses ?

2005-07-11 Thread Andreas
Tom Lane schrieb: Andreas <[EMAIL PROTECTED]> writes: It still showed tcp0 0 :::5432 :::*LISTEN unix 2 [ ACC ] STREAM LISTEN 65292 /tmp/.s.PGSQL.5432 I'll bet you have -i on the postmaster command line; that overr

Re: [GENERAL] PG 8.0.3 ignores parameter listen_addresses ?

2005-07-11 Thread Tom Lane
Andreas <[EMAIL PROTECTED]> writes: > I wrote listen_addresses = 'localhost,192.168.100.1' in the > postgresql.conf restartet the pg-server and looked with netstat -lan > |grep 5432. > It still showed > tcp0 0 0.0.0.0:54320.0.0.0:* LISTEN > tcp0

[GENERAL] PG 8.0.3 ignores parameter listen_addresses ?

2005-07-11 Thread Andreas
Hi, I compiled a Postgres 8.0.3 on a SuSE 9.3 system. This sytem has several network-interfaces. One points to the wild internet. Now I'd like postgres only to listen for localhost, the LAN and probaply the socket. I wrote listen_addresses = 'localhost,192.168.100.1' in the postgresql.conf res

Re: [GENERAL] Transaction isolation levels

2005-07-11 Thread Alvaro Herrera
On Sat, Jul 09, 2005 at 01:13:13PM +0200, Geert Jansen wrote: > "Read Committed is the default isolation level in PostgreSQL. When a > transaction runs on this isolation level, a SELECT query sees only data > committed before the query began; it never sees either uncommitted data > or changes c

Re: [GENERAL] Foreign Key written as a trigger

2005-07-11 Thread Tom Lane
"George Woodring" <[EMAIL PROTECTED]> writes: > I have a database that has been upgrade numerous times (Started about > 7.1 and is not 7.4.8). The table has 2 foreign keys on it, but when I > look at the table I see that the FK applied before 7.4.X is written as a > trigger. Everything seems to w

[GENERAL] Foreign Key written as a trigger

2005-07-11 Thread George Woodring
I have a database that has been upgrade numerous times (Started about 7.1 and is not 7.4.8). The table has 2 foreign keys on it, but when I look at the table I see that the FK applied before 7.4.X is written as a trigger. Everything seems to work, I was just wondering if there are any performance

Re: [GENERAL] DB/clog corruption

2005-07-11 Thread Tom Lane
"Reid Thompson" <[EMAIL PROTECTED]> writes: > $ pg_dump -f table_dump.sql -t table_with_error dbname > FATAL 2: read of clog file 1559, offset 0 failed: Success You've got a clobbered tuple header in that file (ridiculous xmin or xmax value). Alternatively, given the evident age of this server,

[GENERAL] Transaction isolation levels

2005-07-11 Thread Geert Jansen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm having some trouble with transaction isolation levels, and would appreciate some input on this. According to the documentation of PostgreSQL 8.0.3, section 12.2: "Read Committed is the default isolation level in PostgreSQL. When a transact

[GENERAL] array Q

2005-07-11 Thread André M. Winter - Carto.net
hi, i am working on a dataset containing *ordered* lists of points. in order to keep things simple, i only have to tables: - points with ids, - tours with ids and arrays of points-ids (called 'stations'). there is no other relation between those tables. on a certain point i am doing an implic

[GENERAL] install problem

2005-07-11 Thread wayne schlemitz
I have been trying to install postgresql 7.4 and 8.0 with no success. Found what I believe to be rpm's for my SuSE 8.0 . The 8.0.2 is in /usr/local/src/postgres and the 7.4 is in /home/wayne/temp/postgres. have the following directories and told they may be of help var/db/ var/lib/ usr/local/ the s

Re: [GENERAL] index usage in multi-column ORDER BY

2005-07-11 Thread Adam Pritchard
> Not that it changes anything, but I assume you meant to create > the first index on c1. Yes, I did -- that was just a typo in the example. Thanks for pointing it out. Adam Pritchard ---(end of broadcast)--- TIP 4: Have you searched our list ar

[GENERAL] How to fix invalid multibyte character for locale error

2005-07-11 Thread Andrus
I created Postgres 8 database in Windows XP using CREATE DATABASE mydb ENCODING='UNICODE'; and upsized data to it. The query SELECT name FROM customer ORDER BY UPPER(name); returns error ERROR: invalid multibyte character for locale HINT: The server's LC_CTYPE locale is probably incompati

[GENERAL] DB/clog corruption

2005-07-11 Thread Reid Thompson
I've a db table generating the error below on pg_dump. Per the archives, i've tried creating a clog file 1559 but w/o success ( continue to get the same error) even when i extended the clog file to > 64K. Are there other options to recovering this table? Do i need to extend clog 1559 to a greate