Re: [GENERAL] plpgsql functions

2008-08-15 Thread Pavel Stehule
2008/8/15 c k <[EMAIL PROTECTED]>: > Hi, > I am getting an error for a function written in plpgsql, as - > > CREATE OR REPLACE FUNCTION uf_accgroupbal(date, date, p_company integer) > RETURNS SETOF uf_closingbal AS > $BODY$begin > select accgroups."accgroupid", COALESCE(sum(osc),0) as obc, > COAL

[GENERAL] What's size of your PostgreSQL Database?

2008-08-15 Thread Amber
Dear all: We are currently considering using PostgreSQL to host a read only warehouse, we would like to get some experiences, best practices and performance metrics from the user community, following is the question list: 1. What's size of your database? 2. What Operating System are you using

Re: [GENERAL] Re: pg_restore fails on Windows

2008-08-15 Thread Tom Lane
I wrote: > Of course the larger issue is why it's failing --- 150MB doesn't seem > like that much for a modern machine. I suspect that PQerrorMessage() > would tell us something useful, but pg_restore isn't letting us see it. I've applied a patch for the latter issue. But the only way we can fin

Re: [GENERAL] How to tell if a trigger is disabled

2008-08-15 Thread Tom Lane
"Ian Harding" <[EMAIL PROTECTED]> writes: > Is there any way to tell if a trigger or triggers are disabled on a > table? I was updating some data a week or two ago and must have > forgotten to re-enable the triggers. Took me a little while to figure > out. \d tablename didn't tell me, nor did \d

[GENERAL] How to tell if a trigger is disabled

2008-08-15 Thread Ian Harding
Is there any way to tell if a trigger or triggers are disabled on a table? I was updating some data a week or two ago and must have forgotten to re-enable the triggers. Took me a little while to figure out. \d tablename didn't tell me, nor did \d+ tablename. This is on 8.2.3. Thanks, - Ian -

Re: [GENERAL] plpgsql functions

2008-08-15 Thread Christophe
On Aug 15, 2008, at 1:47 PM, Raymond O'Donnell wrote: For functions return SETOF any type, you need to use the following idiom: Or, you can use, RETURN QUERY -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgr

Re: [GENERAL] Horology test failure while compiling PostgreSQL 8.3.3 on Solaris 10 x64

2008-08-15 Thread F. Jovan Jester
CFLAGS="-R/opt/usr/local/amd64/lib -xmodel=medium - xtarget=generic64 -fast -xarch=amd64" What does "-fast" do? If it involves any reinterpretation of IEEE float arithmetic accuracy requirements, drop it. The -fast option using sun studio cc expands to include the flag - fsimple=2 whi

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Roderick A. Anderson
Steve Atkins wrote: On Aug 15, 2008, at 12:16 PM, Andrew Sullivan wrote: On Fri, Aug 15, 2008 at 07:44:36AM -0700, Roderick A. Anderson wrote: Thanks again. This is a pretty specialized application (at this time) so the RRTYPEs used are limited. I am trying to make the model and Pg implem

Re: [GENERAL] plpgsql functions

2008-08-15 Thread Raymond O'Donnell
On 15/08/2008 20:12, c k wrote: Hi, I am getting an error for a function written in plpgsql, as - CREATE OR REPLACE FUNCTION uf_accgroupbal(date, date, p_company integer) RETURNS SETOF uf_closingbal AS For functions return SETOF any type, you need to use the following idiom: ... declare

Re: [GENERAL] syntax error at or near "PERFORM"

2008-08-15 Thread Raymond O'Donnell
On 15/08/2008 05:32, Dale wrote: On Aug 15, 2:14 pm, Dale <[EMAIL PROTECTED]> wrote: even when I try executing something basic: PERFORM (2 + 3); I found my problem. Unfortunately PERFORM can only be used within a "LANGUAGE plpgsql" script. Yes, that's it - outside a function, you just d

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Andrew Sullivan
On Fri, Aug 15, 2008 at 09:54:26PM +0200, Tino Wildenhain wrote: > looks like you want to write your own "powerdns" ? :-) > http://www.powerdns.com/ Oh, right, I forgot they use a SQL back end. They do EDNS0, too :) (Note, however, that if you plan to deploy DNSSEC you're out of luck with them.

Re: [GENERAL] Regression failing on build -> ERROR: could not access file "$libdir/plpgsql": No such file or directory

2008-08-15 Thread Tom Lane
Reid Thompson <[EMAIL PROTECTED]> writes: > Would plpgsql.so get built with.. > ./configure --prefix=/usr/local/pgsql833 --without-readline --disable-shared Uh, no. That probably explains why regress.so didn't get bui

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Tino Wildenhain
Roderick A. Anderson wrote: Anyone aware of an ER model for holding name server records? Working on the zone file data and I am getting close but keep running into the differences between MX records (with a priority) and the others that can hold either a domain/sub-domain/host name or an IP ad

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Steve Atkins
On Aug 15, 2008, at 12:16 PM, Andrew Sullivan wrote: On Fri, Aug 15, 2008 at 07:44:36AM -0700, Roderick A. Anderson wrote: Thanks again. This is a pretty specialized application (at this time) so the RRTYPEs used are limited. I am trying to make the model and Pg implementation as generic

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Andrew Sullivan
On Fri, Aug 15, 2008 at 07:44:36AM -0700, Roderick A. Anderson wrote: > Thanks again. This is a pretty specialized application (at this time) so > the RRTYPEs used are limited. I am trying to make the model and Pg > implementation as generic as possible in case it gets released into the > wil

[GENERAL] plpgsql functions

2008-08-15 Thread c k
Hi, I am getting an error for a function written in plpgsql, as - CREATE OR REPLACE FUNCTION uf_accgroupbal(date, date, p_company integer) RETURNS SETOF uf_closingbal AS $BODY$begin select accgroups."accgroupid", COALESCE(sum(osc),0) as obc, COALESCE(sum(osd),0) as obd, COALESCE(sum(csc),0) as s

Re: [GENERAL] Killing active users

2008-08-15 Thread Glyn Astill
> The problem is that sometimes the rename fails because > there are active > users on the available DB... DBD::Pg::db do failed: ERROR: > database > "maindb" is being accessed by other users . > Because the reload takes > place in the wee hours, I feel it's OK to kill any > existing user > connec

[GENERAL] Changing between ORDER BY DESC and ORDER BY ASC

2008-08-15 Thread William Garrison
Is there an easy way to write one single query that can alternate between ASC and DESC orders? Ex: CREATE OR REPLACE FUNCTION GetSomeStuff(_start integer, _count integer, _sortDesc boolean) RETURNS SETOF text AS $BODY$ SELECT something

Re: [GENERAL] Regression failing on build -> ERROR: could not access file "$libdir/plpgsql": No such file or directory

2008-08-15 Thread Reid Thompson
On Fri, 2008-08-15 at 11:03 -0400, Tom Lane wrote: > Reid Thompson Woulwrites: > > I'm getting this failure on compilation. Could someone point me in the > > direction of a fix? > > You probably ought to inquire into the cause of these: > > gmake[2]: stat:regress.so: There are too many levels of

Re: [GENERAL] Custom sort

2008-08-15 Thread Artacus
Can you define a custom sort in postgres? For instance in mysql, you could do something like (I forget the exact syntax) ORDER BY FIND_IN_SET(column_name, ('one','two','three')) I don't really know this syntax but isn't it something like : ORDER BY column_name='one', column_name='two', colum

Re: [GENERAL] Horology test failure while compiling PostgreSQL 8.3.3 on Solaris 10 x64

2008-08-15 Thread Tom Lane
"Dot Yet" <[EMAIL PROTECTED]> writes: > Configure command: > ./configure --prefix=/opt/usr/local/amd64 --with-openssl > --with-libraries=/opt/usr/local/amd64/lib > --with-includes=/opt/usr/local/amd64/include > --libdir=/opt/usr/local/amd64/lib --includedir=/opt/usr/local/amd64/include > CFLAGS="-R

Re: [GENERAL] Regression failing on build -> ERROR: could not access file "$libdir/plpgsql": No such file or directory

2008-08-15 Thread Tom Lane
Reid Thompson <[EMAIL PROTECTED]> writes: > I'm getting this failure on compilation. Could someone point me in the > direction of a fix? You probably ought to inquire into the cause of these: > gmake[2]: stat:regress.so: There are too many levels of symbolic links to > translate a path name. U

Re: [GENERAL] Update taking forever

2008-08-15 Thread Jan Otto
Hi Oliver, currently idle except for the update statement. Any suggestions why it takes so long to update a couple million rows? update characters set last_update = null Try to update only rows that not already null. update characters set last_update = null where last_update is not null;

[GENERAL] Horology test failure while compiling PostgreSQL 8.3.3 on Solaris 10 x64

2008-08-15 Thread Dot Yet
Hi Eveyone, I am trying to compile PostgreSQL 8.3.3 on Solaris 10 x64. The tools involved were: OpenSSL 0.9.8h 28 May 2008 PostgreSQL 8.3.3 CC: Sun C++ 5.8 2005/10/13 Configure command: ./configure --prefix=/opt/usr/local/amd64 --with-openssl --with-libraries=/opt/usr/local/amd64/lib --with-incl

Re: [GENERAL] Re: pg_restore fails on Windows

2008-08-15 Thread Tom Lane
=?us-ascii?Q?Tom=20Tom?= <[EMAIL PROTECTED]> writes: > Magnus Hagander wrote: >> Can you set up a reproducible test-case that doesn't involve your data, > - test row was inserted using the Java client code > INSERT INTO hibtableattachmentxmldata VALUES (?,?,?) > where value 1 is "" > value 2 i

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Roderick A. Anderson
David Goodenough wrote: On Friday 15 August 2008, Roderick A. Anderson wrote: Anyone aware of an ER model for holding name server records? Working on the zone file data and I am getting close but keep running into the differences between MX records (with a priority) and the others that can hold

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Roderick A. Anderson
Andrew Sullivan wrote: On Thu, Aug 14, 2008 at 04:20:14PM -0700, Roderick A. Anderson wrote: Anyone aware of an ER model for holding name server records? What about a datatype? I have reason to believe that a company I used to work for implemented such a thing. There was some talk of releasi

Re: [GENERAL] Confronting the maximum column limitation

2008-08-15 Thread Scott Ribe
> The > real problem lies with the columns (biological samples) in that it is > rarely the case that we'll have multiple matrices with overlap in columns Should each configuration have its own table, while inheriting from a common base table? -- Scott Ribe [EMAIL PROTECTED] http://www.killerbyte

[GENERAL] Regression failing on build -> ERROR: could not access file "$libdir/plpgsql": No such file or directory

2008-08-15 Thread Reid Thompson
I'm getting this failure on compilation. Could someone point me in the direction of a fix? Thanks, reid System: AIX 5.3 $ uname -a AIX aix53-dev-1 3 5 000B357F4C00 Configuration params: ./configure --prefix=/usr/local/pgsql833 --without-readline --disable-shared The Error: ...SNIP... /usr/bi

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Andrew Sullivan
On Fri, Aug 15, 2008 at 10:26:54AM +0100, David Goodenough wrote: > Have you looked at mydns? It is a database driven DNS server - and it > works just fine with Postgresql. Given that the references section of its documentation doesn't include a number of important RFCs, are you quite sure it's

[GENERAL] Killing active users

2008-08-15 Thread Gauthier, Dave
Hi: I have a system where I have 2 DBs. The first is available to the users for general interaction. The second gets reloaded with new data once per night and is then "renamed" to the active one if/when the reload went successfully, preserving the old DB as a standby. Here's a snapshot of th

Re: [GENERAL] table name length restriction

2008-08-15 Thread Peter Eisentraut
Am Friday, 15. August 2008 schrieb Thomas Finneid: > First question is, what is the rationale behind having a limit on the > table name? Is is an implementation detail. Fixed-length name fields are more efficient to process. And when you have fixed-length fields you need to choose some reasona

[GENERAL] table name length restriction

2008-08-15 Thread Thomas Finneid
Hi I (well, a colleague of mine) have a problem where table names are longer than the 70 char limit. The names must be human readable, i.e. no synthetic name mapping etc. The table creation and the created name are executed automatically, so an algorithm to create a fancy short name is just m

[GENERAL] UTF8 in commandprompt (CMD) on XP fails. Tips?

2008-08-15 Thread Erwin Moller
Hi group, I am trying to set up a testenvironment on my developmachine (XP Prof SP3), using PHP as a scriptinglanguage to access Postgres (8.3). I am working on a multilanguagal database, so I picked UTF8 as encoding for this database. Right now I am able to: 1) Send information (Including

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread David Goodenough
On Friday 15 August 2008, Roderick A. Anderson wrote: > Anyone aware of an ER model for holding name server records? > > Working on the zone file data and I am getting close but keep running > into the differences between MX records (with a priority) and the others > that can hold either a domain/s

[GENERAL] Update taking forever

2008-08-15 Thread Oliver Weichhold
The below statement is now running for 18 hours on a table with ~8 Million Rows, no triggers no fancy stuff. The database is otherwise performing very well and the server is a development server that's currently idle except for the update statement. Any suggestions why it takes so long to update a

[GENERAL] Re: pg_restore fails on Windows

2008-08-15 Thread Tom Tom
Magnus Hagander wrote: > Tom Tom wrote: > > Magnus Hagander wrote: > >> Tom Tom wrote: > Tom Tom wrote: > > Hello, > > > > We have a very strange problem when restoring a database on Windows XP. > > The PG version is 8.1.10 > > The backup was made with the pg_dump on the sa