[GENERAL] Converting bytea to LargeObject

2010-02-17 Thread Satish Burnwal (sburnwal)
I am also having the problem as mentioned in http://archives.postgresql.org/pgsql-general/2009-01/msg00771.php. However, the sql statement: UPDATE tbl SET newoid = ( SELECT oid FROM ( SELECT oid, lowrite(lo_open(oid, 131072), byteafield) FROM lo_create(0) o(oid)) x);

Re: [GENERAL] Source RPMs for PostgreSQL 7.4.27 on RHEL4

2010-02-17 Thread Devrim GÜNDÜZ
On Wed, 2010-02-17 at 08:45 +0200, Devrim GÜNDÜZ wrote: I just started uploading SRPMs to ftp.postgresql.org. It will take a few hours to sync. ...and packages hit main FTP site. Regards, -- Devrim GÜNDÜZ, RHCE PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer devrim~gunduz.org,

[GENERAL] Persistent identifiers for Postgres users

2010-02-17 Thread Peter Geoghegan
Hello, I maintain an app where database users correspond to actual users, with privileges granted or denied to each. At the moment, records that each user creates are identified as such by a text column that has a default value of session_user(). I don't need to tell you that this is suboptimal,

Re: [GENERAL] Having a plpgsql function return multiple rows that indicate its progress in a cursor like fashion

2010-02-17 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: Peter Geoghegan peter.geoghega...@gmail.com writes: Aren't my requirements sufficiently common to justify developing a mechanism to report progress back to client applications during batch operations and the like? Have you experimented with RAISE NOTICE?

[GENERAL] error creating database

2010-02-17 Thread Geoffrey
I'm trying to reload a database and I'm receiving the following error: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 5181; 1262 45260 DATABASE nev postgres pg_restore: [archiver (db)] could not execute query: ERROR: encoding LATIN1

Re: [GENERAL] error creating database

2010-02-17 Thread Chris Barnes
This depends on your OS. If you are running (linux) redhat or centos you would edit this file /etc/sysconfig/i18n and change your locale to, for example. Save it and reboot. There are probably ways around this when creating the database, but we install our OS with this in mind.

Re: [GENERAL] Having a plpgsql function return multiple rows that indicate its progress in a cursor like fashion

2010-02-17 Thread Peter Geoghegan
Hi dim, Would returning a refcursor then using fetch in the application be another solution? I assume not, since nobody stepped forward and offered a way, even though I suggested that returning a refcursor may be the way to go (you'll recall that you suggested that to me in IRC - I'm

Re: [GENERAL] COPY FROM wish list

2010-02-17 Thread Dimitri Fontaine
Scott Bailey arta...@comcast.net writes: PgFoundry has http://pgfoundry.org/projects/pgloader/ It is a step in the right direction but definitely not as powerful as sql*loader. Yeah, it's only offering what I needed and what I've been requested to add. So far there's support for INFORMIX

[GENERAL] pg_database_size(oid)

2010-02-17 Thread Dhimant Patel
Hi All, I have just started with postgres and after going through manual nearly for 2 hours, I need help. I have created a database, which I plan to load with several tables. I am trying to find the size of the databases and came across pg_database_size(oid) function. Since it requires databse

Re: [GENERAL] pg_database_size(oid)

2010-02-17 Thread Tom Lane
Dhimant Patel drp4...@gmail.com writes: I have created a database, which I plan to load with several tables. I am trying to find the size of the databases and came across pg_database_size(oid) function. Since it requires databse oid, I thought there must be a view where you get it - then came

Re: [GENERAL] pg_database_size(oid)

2010-02-17 Thread Reid Thompson
On Wed, 2010-02-17 at 11:59 -0500, Dhimant Patel wrote: I have created a database, which I plan to load with several tables. I am trying to find the size of the databases and came across pg_database_size(oid) function. Since it requires databse oid, I thought there must be a view where you

[GENERAL] Reading a table with composite type, into it equivalent c structure

2010-02-17 Thread mike stanton
Hello All, Has anyone got a working program that reads a tuple from a table (defined as a single Composite type with lower atributes also as composite types) and converts the data into the corresponding C structure variables ? I've been looking for a working example, but havn´t found that

Re: [GENERAL] ERROR: permission denied to finish prepared transaction

2010-02-17 Thread David Kerr
On Tue, Feb 16, 2010 at 12:57:28PM -0800, David Kerr wrote: - I'm seeing a bunch of these error messages: - Feb 16 12:04:51 QA-HC01-DB01 postgres-hc01[26420]: [2-1] user=xy,db=x,pid=26420 ERROR: permission denied to finish prepared transaction - Feb 16 12:04:51 QA-HC01-DB01 postgres-hc01[26420]:

Re: [GENERAL] dump of 700 GB database

2010-02-17 Thread karsten vennemann
vacuum should clean out the dead tuples, then cluster on any large tables that are bloated will sort them out without needing too much temporary space. Yes ok am running a vacuum full on a large table (150GB) and will cluster the spatial data by zip code then. Understand that should get

Re: [GENERAL] dump of 700 GB database

2010-02-17 Thread Scott Marlowe
On Wed, Feb 17, 2010 at 3:44 PM, karsten vennemann kars...@terragis.net wrote: vacuum should clean out the dead tuples, then cluster on any large tables that are bloated will sort them out without needing too much temporary space. Yes ok  am running a vacuum full on a large table

Re: [GENERAL] dump of 700 GB database

2010-02-17 Thread karsten vennemann
Note that cluster on a randomly ordered large table can be prohibitively slow, and it might be better to schedule a short downtime to do the following (pseudo code) alter table tablename rename to old_tablename; create table tablename like old_tablename; insert into tablename select *

Re: [GENERAL] tuning bgwriter in 8.4.2

2010-02-17 Thread Greg Smith
Ben Chobot wrote: As I understand things, assuming I don't keep updating the same pages then buffers_backend should be a small percentage of buffers_alloc, and buffers_clean should be larger than it is compared to buffers_checkpoint. Is my understanding correct? Sure; your buffers_clean is

Re: [GENERAL] tuning bgwriter in 8.4.2

2010-02-17 Thread Ben Chobot
On Feb 17, 2010, at 3:41 PM, Greg Smith wrote: Ben Chobot wrote: As I understand things, assuming I don't keep updating the same pages then buffers_backend should be a small percentage of buffers_alloc, and buffers_clean should be larger than it is compared to buffers_checkpoint. Is my

Re: [GENERAL] tuning bgwriter in 8.4.2

2010-02-17 Thread Greg Smith
Ben Chobot wrote: Is there a way to tell if I really am just keeping the same few pages dirty throughout every checkpoint? I wouldn't have expected that, but given our application I suppose it is possible. You can install pg_buffercache and look at what's in the cache to check your theory.

Re: [GENERAL] pg_database_size(oid)

2010-02-17 Thread Greg Smith
Dhimant Patel wrote: I have created a database, which I plan to load with several tables. I am trying to find the size of the databases and came across pg_database_size(oid) function. Here's what you probably want: select datname,pg_size_pretty(pg_database_size(pg_database.oid)) from

[GENERAL] Doubts about oid

2010-02-17 Thread Jayadevan M
Hi, I was reading about oid and default configuration of PostgreSQL. A couple of doubts 1) Why is use of OIDS considered deprecated? Is there something else that can be used in place of oids for user tables? 2) Is there a performance impact if we keep the default default_with_oids to ON?

[GENERAL] DDL trigger kind functionality in PostGreSQL

2010-02-17 Thread dipti shah
Hi, I was looking for SQL DDL trigger kind of functionality in PostGreSQL but couldn;t find any. Could anyone please tell me how to achieve the similar functionality in PostGreSQL. Basically I want to make sure that no users should use DROP command directly on my database even though he/she owner

[GENERAL] returning records from plpython

2010-02-17 Thread Scott Bailey
Does anyone know why plpython doesn't support returning record? I couldn't find anything in the archives or source that indicated why it wasn't supported. I'm trying to do Oracle style external tables and xmltable and it would make it much easier if I could return setof record. Scott -- Sent

Re: [GENERAL] pgpool error, pid not found!

2010-02-17 Thread Tatsuo Ishii
Wao. This is pgpool, right? It's not maintained anymore(it was almost 3 years ago). Please use pgpool-II. The latest version is pgpool-II 2.3.2.1. -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese: http://www.sraoss.co.jp Sorry for late reply. I work full

Re: [GENERAL] Howto analyse sql statement.

2010-02-17 Thread Tatsuo Ishii
From: Muhammad Isnaini moch_isna...@yahoo.com Subject: Re: Howto analyse sql statement. Date: Wed, 17 Feb 2010 21:02:26 +0800 (SGT) Message-ID: 525621.291...@web76202.mail.sg1.yahoo.com     parse_tree_list = raw_parser(string); I have got it. I will send later. Next chalange is how writing

[GENERAL] Trying to add a type modifier to user created type

2010-02-17 Thread Carsten Kropf
Hi *, I have the following problem: I wanted to add a new type that supports modifiers (comparable to numeric/varchar). I succeeded in adding the type modifier functions to my new type. These methods are called and the modifier is set. However the modifiers are not applied here. I don't know

[GENERAL] One solution for Packages in Postgre

2010-02-17 Thread venkatrao . b
Hi Posgre Developers, I am new to Postgre. We are migrating an oracle db to postgre. In oracle we have used so many packages. As per my understanding, there is no oracle package like functionality in postgre. I was just trying to find some way to migrate ocale packages to postgre. Please let