[GENERAL] cannot open pg_database

2006-08-21 Thread Jim Bryan
Installing with yum, Fedora core 5. Get error: could not open file global/pg_database: No such file or directory. The file exists however, in /var/lib/pgsql/data/global and contains 3 lines: “postgres” 10793 1663 499 499 “template” 1 1663 499 499 “template0” 10792 1663 499 499 From the

[GENERAL] Confused about locales

2006-08-21 Thread John Gunther
I've been reading about locales, encodings, sort orders, the to_ascii function and, embarrasingly, I'm more confused than enlightened.: What I want is very simple: 1) I want the database to correctly accept, store, and display alphabetic characters, including European accented characters, in

[GENERAL] service postgresql start : failed

2006-08-21 Thread Jim
FC5. Using yum (which downloaded a few addition dependencies in the process) to install: postgresqlpostgresql-serverpostgresql-libspostgresql-docspostgresql-contribpostgresql-jdbdpostgresql-odbcpostgresql-pl [EMAIL PROTECTED] ~]# /sbin/chkconfig postgresql on[EMAIL

Re: [GENERAL] Inserting Data

2006-08-21 Thread Bob Pawley
Hi Michael Yes - Multiple rows of the same data are created in each secondary table. I have two triggers that are identical in format although handling different tables. One is triggeres after insert and with this there is no multiplying factor. The other is triggered after an update. Both

Re: [GENERAL] cannot open pg_database

2006-08-21 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-08-19 20:18:53 -0700: Installing with yum, Fedora core 5. Get error: could not open file global/pg_database: No such file or directory. The file exists however, in /var/lib/pgsql/data/global and contains 3 lines: “postgres” 10793 1663 499 499 “template” 1 1663

[GENERAL] Queries joining views

2006-08-21 Thread Alban Hertroys
Is there a trick to make this work a bit faster? We have a number of views that join tables, and we have queries that join those views. Some relatively large tables are involved. We added indexes that match our query constraints as much as possible, and that does work if we explicitly query

Re: [GENERAL] Locale, encoding, sort order confusion

2006-08-21 Thread John Gunther
Alvaro Herrera wrote: For example, with all LC_* parameters set to "en_US.UTF8", I get the following incorrect "order:by": Barn Bcancour Beaupr Did you initdb with locale en_US.UTF8, and also createdb with encoding UTF8? While you can certainly choose mismatching values

Re: [GENERAL] cannot open pg_database

2006-08-21 Thread Tom Lane
Jim Bryan [EMAIL PROTECTED] writes: Installing with yum, Fedora core 5. Get error: could not open file global/pg_database: No such file or directory. It seems pretty odd that that would be the first error. The file exists however, in /var/lib/pgsql/data/global and contains 3 lines: OK

Re: [GENERAL] Queries joining views

2006-08-21 Thread John D. Burger
Alban Hertroys wrote: We have a number of views that join tables, and we have queries that join those views. Some relatively large tables are involved. We added indexes that match our query constraints as much as possible, and that does work if we explicitly query the tables with all the

[GENERAL] setting the value returned by PQcmdTuples

2006-08-21 Thread Jeff Davis
I have an ON INSERT DO INSTEAD rule that calls a function to do the insert (via SELECT myfunction(...)). How do I set the number returned by PQcmdTuples? Regards, Jeff Davis ---(end of broadcast)--- TIP 4: Have you searched our list

Re: [GENERAL] Queries joining views

2006-08-21 Thread Tom Lane
Alban Hertroys [EMAIL PROTECTED] writes: Is there a trick to make this work a bit faster? Have you really shown us the right queries for those explain results? I don't see where the second plan is testing dir 1 at all. It looks like the first one is faster because it's using a partial index

Re: [GENERAL] Queries joining views

2006-08-21 Thread Tom Lane
John D. Burger [EMAIL PROTECTED] writes: Anecdotally, I had a situation recently where I got different plans depending on whether I queried a join of a view against itself, or macro expanded the view by hand. I was =very= surprised at this. Me too, at least if you didn't do any hand

Re: [GENERAL] cannot open pg_database

2006-08-21 Thread louis gonzales
Also, what is you $PGDATA variable pointing to? Issue: env | grep PG see what that comes out with. Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-08-19 20:18:53 -0700: Installing with yum, Fedora core 5. Get error: could not open file global/pg_database: No such file or directory.

Re: [GENERAL] Queries joining views

2006-08-21 Thread John D. Burger
Tom Lane wrote: Anecdotally, I had a situation recently where I got different plans depending on whether I queried a join of a view against itself, or macro expanded the view by hand. I was =very= surprised at this. Me too, at least if you didn't do any hand optimization but just stuck the

Re: [GENERAL] Queries joining views

2006-08-21 Thread DelGurth
Alban Hertroys alban ( at ) magproductions ( dot ) nl writes: Is there a trick to make this work a bit faster? Have you really shown us the right queries for those explain results?I don't see where the second plan is testing dir 1 at all.It looks like the first one is faster because it's using a

Re: [GENERAL] Queries joining views

2006-08-21 Thread Tom Lane
DelGurth [EMAIL PROTECTED] writes: As you can see we tried some indexes, to see if we could get the queries on the views to become faster. Indexes: mm_insrel_table_pkey PRIMARY KEY, btree (number) mm_insrel_dir_not_one_idx btree (dnumber, snumber) WHERE dir 1

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-21 Thread elein
The technique for a single part gapless sequence and a two-part gapless sequence has been published today at http://www.varlena.com/GeneralBits. I'd be interested to hear of high concurrency usage that would break it or be notably slow. --elein [EMAIL PROTECTED] ---(end

[GENERAL] stats reset during pg_restore?

2006-08-21 Thread George Pavlov
I would like to analyze server stats offline, so I attempt to pg_dump my production database and then pg_restore it into another database. In the process all stats seem to be reset (they are not completely zeroed). So in production I have a table with the following stats (from pg_stat_all_tables

[GENERAL] Standby system script

2006-08-21 Thread Jeff Davis
I remember recently someone posted a script to get an 8.1 system to act as a standby system. The way it worked was the recovery command looped waiting for more WAL files. However, I can't seem to find this script anymore. Does someone have a link to it? I know 8.2 will have a nicer system, but

Re: [GENERAL] Queries joining views

2006-08-21 Thread DelGurth
BTW, what PG version is this exactly?Our PG version is the version downloadable from http://www.sunfreeware.com/programlistsparc10.html#postgresql , so 8.0.1 for solaris sparc.Sorry I was wrong on this point, it's 8.1.4-bash-3.00$ pg_config --versionPostgreSQL 8.1.4And it's the version from

Re: [GENERAL] Queries joining views

2006-08-21 Thread DelGurth
On 8/21/06, Tom Lane [EMAIL PROTECTED] wrote: Hmph ... it certainly appears to be choosing the wrong index in thesecond case.I wonder why --- can you show the relpages and reltuplesstats from pg_class for these indexes?I'm personally not aware how to do that, perhaps Alban will (tell me how to) do

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-21 Thread Jorge Godoy
elein [EMAIL PROTECTED] writes: The technique for a single part gapless sequence and a two-part gapless sequence has been published today at http://www.varlena.com/GeneralBits. I'd be interested to hear of high concurrency usage that would break it or be notably slow. --elein [EMAIL

Re: [GENERAL] Inserting Data

2006-08-21 Thread Michael Fuhr
On Mon, Aug 21, 2006 at 08:27:58AM -0700, Bob Pawley wrote: Yes - Multiple rows of the same data are created in each secondary table. I have two triggers that are identical in format although handling different tables. One is triggeres after insert and with this there is no multiplying

Re: [GENERAL] Queries joining views

2006-08-21 Thread Tom Lane
DelGurth [EMAIL PROTECTED] writes: On 8/21/06, Tom Lane [EMAIL PROTECTED] wrote: It might be interesting also to examine the output of just explain select * from mm_insrel_table where dnumber=558332 and dir1 with different subsets of these indexes in place. Ok. Did that (with your trick,

[GENERAL] Postgresql, Perl and DBI connect problem

2006-08-21 Thread Bernard Miville
Hi, I am just trying to connect to a Postgresql DB using a Perl cgi script from a web page from my own computer on a remote network. I am using Postgresql 8.1.4 on Fedora Core 5 with a Linux firewall that allows all traffic. Postmaster is running with -i and I tried different -h (including

Re: [GENERAL] Postgresql, Perl and DBI connect problem

2006-08-21 Thread Tom Lane
Bernard Miville [EMAIL PROTECTED] writes: I am just trying to connect to a Postgresql DB using a Perl cgi script from a web page from my own computer on a remote network. I am using Postgresql 8.1.4 on Fedora Core 5 with a Linux firewall that allows all traffic. Given that it's a permission

Re: [GENERAL] Postgresql, Perl and DBI connect problem

2006-08-21 Thread Bernard Miville
Hi Tom, It now works! I hate SELinux, it always cause me problems. Any suggestion on how to make SELinux happy without having to turn it off. Thanks, Bernard Tom Lane wrote: Bernard Miville [EMAIL PROTECTED] writes: I am just trying to connect to a Postgresql DB using a Perl cgi script

Re: [GENERAL] Postgresql, Perl and DBI connect problem

2006-08-21 Thread Tom Lane
Bernard Miville [EMAIL PROTECTED] writes: It now works! I hate SELinux, it always cause me problems. It's still got a lot of rough edges, for sure, but I think the idea is sound. (And I'm not just saying that because I work for Red Hat ... just look at all the fun Windows users are having

Re: new FAQ entry (was:Re: [GENERAL] UTF8 problem)

2006-08-21 Thread Bruce Momjian
Instead of adding an FAQ entry, which might not be found when the error is generated, I added a HINT for 8.2 that will appear with the error message: errmsg(invalid byte sequence for encoding \%s\: 0x%s, pg_enc2name_tbl[encoding].name,

Re: [GENERAL] pgxml xpath_table

2006-08-21 Thread Bruce Momjian
John Gray wrote: On Sat, 2006-06-10 at 14:06 -0400, Tom Lane wrote: John Gray [EMAIL PROTECTED] writes: This is the reason why xpath_table allows you to specify an identifying field (usually a primary key but doesn't have to be)- the solution to your question is to join an xpath_table

[GENERAL] UUID as primary key

2006-08-21 Thread Vance Maverick
I'm considering using a UUID as a primary / foreign key for my schema, to help ensure portability of data in a multi-master context. Does anyone have experience with this? There's a project on Gborg (pguuid) to create a native UUID type, but it looks stagnant (and I'd prefer to use PostgreSQL