Re: [GENERAL] Search Path vs Synonyms

2009-07-24 Thread Albe Laurenz
Matthew Seaborn wrote: Given the situation where a user connecting to the database needs access to two separate schemas: the primary schema which contains the data they will be updating and a second schema which contains read-only reference data, used by many users, that will be using in

Re: [GENERAL] ECPG Deallocate PREPARE statement - bug ?

2009-07-24 Thread Albe Laurenz
l...@crysberg.dk wrote: I have a program that I need compile using PostgreSQL 8.4.0 (or later) and it must be able to run on an 8.3.5 based system as well as 8.4.0. I'm using embedded SQL for C and I have the following sequence of statements: snprintf( stmt, 3000, SELECT count(*)

Re: [GENERAL] Search Path vs Synonyms

2009-07-24 Thread Matthew Seaborn
Ah, I am actually using EnterpriseDB (a commercial 'fork' of PSQL) which does have synonyms. Is it possible set define the default search_path for a given user? -Original Message- From: Albe Laurenz [mailto:laurenz.a...@wien.gv.at] Sent: 24 July 2009 07:22 To: Matthew Seaborn;

Re: [GENERAL] Search Path vs Synonyms

2009-07-24 Thread John R Pierce
Matthew Seaborn wrote: Ah, I am actually using EnterpriseDB (a commercial 'fork' of PSQL) which does have synonyms. then you likely will get more help from EnterpriseDB's technical support, as only they are really familiar with their proprietary and commercial product. -- Sent via

Re: [GENERAL] Search Path vs Synonyms

2009-07-24 Thread Magnus Hagander
On Fri, Jul 24, 2009 at 09:38, Matthew Seabornmatthew.seab...@performgroup.com wrote: Ah, I am actually using EnterpriseDB (a commercial 'fork' of PSQL) which does have synonyms. For support on EnterpriseDB you should contact EnterpriseDB, not the PostgreSQL community. We can only answer about

[GENERAL] Re: user/grant - best practices handling permission in production system

2009-07-24 Thread Stefano Nichele
Hi Greg, thanks for your suggestions. See below for my comments. Greg Stark wrote: Well there isn't a way to do step 2 in one shot either. Maybe my explanation was not clear. Step2 means run the DDL/DMLscript to create and populate all the tables. You'll have to issue a CREATE statement

Re: [GENERAL] user/grant - best practices handling permission in production system

2009-07-24 Thread Andreas Wenk
Stefano Nichele schrieb: Hi All, I have some questions for you about the best way to handle permission on a database in a production system. The final goal is to have a web application connected to the db using a single user that must run select/delete/insert/update (and maybe truncate) In

Re: [GENERAL] Converting SQL to pg

2009-07-24 Thread Albe Laurenz
martin wrote: I must be tired. Any suggestions on converting the following to postgresql? UPDATE IGNORE yose5_user_newflags AS flags, yose5_messages AS msg SET flags.forum_id = msg.forum_id WHERE flags.message_id = msg.message_id AND flags.message_id IN (15580, 15581, 15706, 15712, 15713,

Re: [GENERAL] Converting SQL to pg

2009-07-24 Thread martin
In article d960cb61b694cf459dcfb4b0128514c203937...@exadv11.host.magwien.gv.at, Albe Laurenz laurenz.a...@wien.gv.at wrote: martin wrote: To PostgreSQL from what? Mysql unless the person try to port the code made some changes to it. Can you explain what the statement is supposed to do? It's

Re: [GENERAL] Converting SQL to pg

2009-07-24 Thread Tommy Gildseth
mar...@cornhobble.com wrote: I must be tired. Any suggestions on converting the following to postgresql? UPDATE IGNORE yose5_user_newflags AS flags, yose5_messages AS msg SET flags.forum_id = msg.forum_id WHERE flags.message_id = msg.message_id AND flags.message_id IN (15580, 15581, 15706,

Re: [GENERAL] ERROR: unexpected data beyond EOF in block of relation RelationName

2009-07-24 Thread Marcin Gon
Hi, Thanks for that. The question for me is how to find an appropriate OS patch for this? Is there a list of required patches for this Postgres release on SuSE? Regards, Marcin --- On Thu, 23/7/09, Tom Lane t...@sss.pgh.pa.us wrote: From: Tom Lane t...@sss.pgh.pa.us Subject: Re: [GENERAL]

Re: [GENERAL] Search Path vs Synonyms

2009-07-24 Thread Matthew Seaborn
Whilst I need EDB for a few of their features, I am keen to keep as PSQL compliant as possible. Thanks for the help ALTER USER userid SET search_path TO schema1,schema2; worked nicely. -Original Message- From: Magnus Hagander [mailto:mag...@hagander.net] Sent: 24 July 2009 08:57 To:

[GENERAL] Replication from Postgres to EDB

2009-07-24 Thread Jazz Johal
Hi Is it possible to setup replication from EDB to Postgres? Thanks

Re: [GENERAL] Copying only incremental records to another DB..

2009-07-24 Thread Alban Hertroys
On 29 Jun 2009, at 6:10, Phoenix Kiula wrote: Hi We're trying PG on a new machine, so we copied our current (live) database to that server. Tested the code and it's all working. Now, to make that second server the main live server, we will need to copy the db again including the new records

Re: [GENERAL] Copying only incremental records to another DB..

2009-07-24 Thread Thomas Kellerer
Alban Hertroys, 24.07.2009 13:07: It would be nice if there were a tool that could do a diff between two dumps resulting in a new dump with just the statements necessary to apply the differences. I don't think there is such a tool yet though (some light Googling does bring up such a tool for

Re: [GENERAL] Replication from Postgres to EDB

2009-07-24 Thread Scott Mead
On Fri, Jul 24, 2009 at 6:31 AM, Jazz Johal johal.j...@googlemail.comwrote: Hi Is it possible to setup replication from EDB to Postgres? You can with slony. I recommend you contact supp...@enterprisedb.com for details. --Scott

Re: [GENERAL] Very slow joins

2009-07-24 Thread MS
Btw. It looks like this issue: http://archives.postgresql.org/pgsql-performance/2007-09/msg00374.php In my case the CPU usage is low too (3%) but IO wait is high (95%). I'm using Postgresql 8.3. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Very slow joins

2009-07-24 Thread John R Pierce
MS wrote: Btw. It looks like this issue: http://archives.postgresql.org/pgsql-performance/2007-09/msg00374.php In my case the CPU usage is low too (3%) but IO wait is high (95%). I'm using Postgresql 8.3. for more info on disk iowaits, use `iostat -x 5` (5 means sample every 5

[GENERAL] FATAL: root page 3 of pg_class_oid_index has level 0, expected 1

2009-07-24 Thread Andrew Radamis
Hello, I'm pretty new to pgsql, so speak slowly and draw plenty of pictures please :P I'm getting this error when I try to log into my database. *FATAL: root page 3 of pg_class_oid_index has level 0, expected 1 *I've done some googleing and I found one mailing list item in another language,

Re: [GENERAL] FATAL: root page 3 of pg_class_oid_index has level 0, expected 1

2009-07-24 Thread Tom Lane
Andrew Radamis rust...@gmail.com writes: I'm getting this error when I try to log into my database. *FATAL: root page 3 of pg_class_oid_index has level 0, expected 1 You've got a corrupted index. You can probably fix it like this: export PGOPTIONS=-P psql ..usual options..

Re: [GENERAL] Replication from Postgres to EDB

2009-07-24 Thread Joshua D. Drake
On Fri, 2009-07-24 at 11:31 +0100, Jazz Johal wrote: Hi Is it possible to setup replication from EDB to Postgres? Probably. Using Slony. As I understand it they explicitly keep backward compatibility. Joshua D. Drake Thanks -- PostgreSQL - XMPP:

Re: [GENERAL] Best way to import data in postgresl (not COPY)

2009-07-24 Thread Denis BUCHER
Hello everyone, Denis BUCHER a écrit : I have a system that must each day import lots of data from another one. Our system is in postgresql and we connect to the other via ODBC. Currently we do something like : SELECT ... FROM ODBC source foreach row { INSERT INTO postgresql } The

[GENERAL] Find difference between two Text fields

2009-07-24 Thread Peter Hunsberger
Can anyone give me a way to find the difference between two text fields on a character by character basis. Essentially, I'd like to logically AND the two together and for any position that has a non-zero result show whatever character is in that position for the second string. The solution can

Re: [GENERAL] split string by special characters

2009-07-24 Thread Andreas Wenk
Jan-Erik wrote: I wonder if you could please help me out to extract a character string to an array or better yet, a table. I'd like to split strings of text up into words and delimiters (but not delete the delimiters). The delimiters are defined as comma, space, dot, singe/double quotation

[GENERAL] Disable databse listing for non-superuser (\l) ?

2009-07-24 Thread Brian A. Seklecki
All: Any suggestions on how-to, or comments on a potential NFR, to disable non-superuser's from viewing the database list via \l? Possibly a postgresql.conf toggle or restrictions on the internal views that constitute say, 'pg_catalog.pg_database'. Something equivalent, in principal, to

Re: [GENERAL] Very slow joins

2009-07-24 Thread MS
I never cease to be amazed at how many times people have these monster CPUs, like dual quad core 3Ghz processors, with 16GB or whatever of ram, and then try and run a database off a single 7200 rpm desktop SATA drive.    at work our production databases often run on dozens of 1 or 15000

Re: [GENERAL] Very slow joins

2009-07-24 Thread Merlin Moncure
On Fri, Jul 24, 2009 at 4:40 PM, MSfretka1...@gmail.com wrote: I never cease to be amazed at how many times people have these monster CPUs, like dual quad core 3Ghz processors, with 16GB or whatever of ram, and then try and run a database off a single 7200 rpm desktop SATA drive.    at work

Re: [GENERAL] Re: user/grant - best practices handling permission in production system

2009-07-24 Thread Erik Jones
On Jul 24, 2009, at 1:11 AM, Stefano Nichele wrote: Hi Greg, thanks for your suggestions. See below for my comments. Greg Stark wrote: Well there isn't a way to do step 2 in one shot either. Maybe my explanation was not clear. Step2 means run the DDL/ DMLscript to create and populate all

Re: [GENERAL] FATAL: root page 3 of pg_class_oid_index has level 0, expected 1

2009-07-24 Thread Andrew Radamis
Hi Tom, Thanks for the reply! The reindex command you provided did not work, it gave the same error as the one I got when logging in earlier, however I was feeling reckless so I did reindex database mydatabase; and that completed as follows: NOTICE: table pg_class was reindexed NOTICE: table

Re: [GENERAL] Disable databse listing for non-superuser (\l) ?

2009-07-24 Thread Scott Marlowe
On Fri, Jul 24, 2009 at 5:02 PM, Brian A. Sekleckilaval...@spiritual-machines.org wrote: All: Any suggestions on how-to, or comments on a potential NFR, to disable non-superuser's from viewing the database list via \l? So, is this a misguided attempt at security through obscurity, or are you

Re: [GENERAL] Disable databse listing for non-superuser (\l) ?

2009-07-24 Thread Brian A. Seklecki
So, is this a misguided attempt at security through obscurity, or are you looking at limiting the noise that users see when they look at databases? The answer to that question would be yes. ~BAS -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] Find difference between two Text fields

2009-07-24 Thread Aleksander Kmetec
Hi, there might be a better solution out there, but it seemed like an interesting problem so I wrote this function: CREATE OR REPLACE FUNCTION stringdiff(text, text) RETURNS TEXT AS $$ SELECT array_to_string(ARRAY( SELECT CASE WHEN substring($1 FROM n FOR 1) =