Re: [GENERAL] Plperl return_next and bytea binary data?

2006-07-24 Thread Philippe Lang
Martijn van Oosterhout wrote: > On Mon, Jul 24, 2006 at 11:43:39AM +0200, Philippe Lang wrote: >> The problem seems to come from the return_next, in conjunction with >> binary data: >> >> >> return_next >> ( >> { >> val => $_[0] *

Re: [GENERAL] Does a GRANT on a table cascade/implied to its SEQUENCES

2006-07-24 Thread Tom Lane
"Roderick A. Anderson" <[EMAIL PROTECTED]> writes: > I've add a new user and as I go though granting various accesses to the > different tables I realized many of those tables have primary keys that > are generated by a sequence. > Do I need to grant access on the sequences and what type of acce

Re: [GENERAL] Beginner's questions about creating a custom data type in PostgreSQL...

2006-07-24 Thread Redefined Horizons
Merlin, Thank you very much for taking the time to write that detailed response to my question. I appreciate it very much. You have helped me understand my design issue better, but I have another question if you have the patience to answer! :] I am actually working on a spatial extension for Po

[GENERAL] sequences vs oids as primary keys

2006-07-24 Thread craigp
i had some questions/thoughts on using sequences vs oids as pks... it's a common requirement to obtain the last value of a sequence after an insert. most other databases support such a feature, but since oid's are deprecated, and only oid's are returned, this isn't supported by postgres (and perfor

Re: [GENERAL] Beginner's questions about creating a custom data type in PostgreSQL...

2006-07-24 Thread Merlin Moncure
On 7/24/06, Redefined Horizons <[EMAIL PROTECTED]> wrote: I've got a few questions about creating custom data types for PostgreSQL. ok, i have a weakness for medieval stuff, so: I'm not sure how to phrase the questions without an example, so here goes: I'd like to create a custom data type r

Re: [GENERAL] CASE statement and SETOF values

2006-07-24 Thread Stephan Szabo
On Mon, 24 Jul 2006, Christian Schoenebeck wrote: > Consider the following server side function: > > CREATE FUNCTION my_function(int4) RETURNS SETOF int8 AS > $BODY$ > SELECT > CASE WHEN (some_condition) > THEN ( > SELECT ... -- arbitrary select (returning row(s) of int8 values) >

[GENERAL] CASE statement and SETOF values

2006-07-24 Thread Christian Schoenebeck
HI! Consider the following server side function: CREATE FUNCTION my_function(int4) RETURNS SETOF int8 AS $BODY$ SELECT CASE WHEN (some_condition) THEN ( SELECT ... -- arbitrary select (returning row(s) of int8 values) ) ELSE ( SELECT ... -- arbitrary select (retur

[GENERAL] Does a GRANT on a table cascade/implied to its SEQUENCES

2006-07-24 Thread Roderick A. Anderson
I'm working on an application ( using Catalyst ) and realized I was using a user with too many privileges to access the database. I've add a new user and as I go though granting various accesses to the different tables I realized many of those tables have primary keys that are generated by a s

Re: [GENERAL] pg_dump & pg_restore suggestion

2006-07-24 Thread Alexandre Arruda
Hi, My wishlist for pg_{dump,restore} have only 1 item: 1) Thats "pg_restore -t file.bkp" returns not only the table, but the related PK and indexes, like "pg_dump -t makes with a operational database. If you drop a table from a database, this drops whole table and, obviously, your indexes. If

Re: [GENERAL] gmake Errors: pg_backup_archiver.c: undefined reference to `lo_create'

2006-07-24 Thread Tom Lane
Emi Lu <[EMAIL PROTECTED]> writes: > The full results for configuration and gmake are saved in the attached > two files. That's hardly full results from gmake --- it looks like it re-used a whole pile of pre-existing .o files. Perhaps what you need is a "make distclean" and start again.

[GENERAL] Beginner's questions about creating a custom data type in PostgreSQL...

2006-07-24 Thread Redefined Horizons
I've got a few questions about creating custom data types for PostgreSQL. I'm not sure how to phrase the questions without an example, so here goes: I'd like to create a custom data type representing a Medieval Knight. (This isn't what I really want to do, it's just an example.) One of the "pro

Re: [GENERAL] gmake Errors: pg_backup_archiver.c: undefined reference to `lo_create'

2006-07-24 Thread Tom Lane
Emi Lu <[EMAIL PROTECTED]> writes: > When I tried to install postgresql 8.1.4, I got the following errors. > pg_backup_archiver.o(.text+0x10f4): In function `StartRestoreBlob': > pg_backup_archiver.c: undefined reference to `lo_create' > collect2: ld returned 1 exit status It looks to me like ld

Re: [GENERAL] unknown error message

2006-07-24 Thread Markus Schiltknecht
On Mon, 2006-07-24 at 14:54 -0400, Tom Lane wrote: > Right offhand the only way that I could see for the tuple to disappear > before the trigger fires is if a concurrent VACUUM removed it, which > should not happen for a tuple inserted by a still-active transaction. > If you've got autovacuum runni

Re: [GENERAL] unknown error message

2006-07-24 Thread Tom Lane
Markus Schiltknecht <[EMAIL PROTECTED]> writes: > Sorry, I was unclear: luckily the error is easily reproducible. The > problem is just to cut unnecessary parts and to come up with a small > test case. I'll give it a try tomorrow. > As far as VACUUM is concerned: I run this data-loading script jus

[GENERAL] gmake Errors: pg_backup_archiver.c: undefined reference to `lo_create'

2006-07-24 Thread Emi Lu
Hello, When I tried to install postgresql 8.1.4, I got the following errors. Could someone tell me what are missing or wrong please? == ./configure --prefix='/home/postgresql/' --without-docdir --without-readline . gmake pg_backup_archiver.o(.text+

[GENERAL] gmake Errors: pg_backup_archiver.c: undefined reference to `lo_create'

2006-07-24 Thread Emi Lu
Hello, When I tried to install postgresql 8.1.4, I got the following errors. Could someone tell me what are missing or wrong please? == ./configure --prefix='/home/postgresql/' --without-docdir --without-readline . gmake pg_backup_archiver.o(.text+0x

Re: [GENERAL] unknown error message

2006-07-24 Thread Tom Lane
Markus Schiltknecht <[EMAIL PROTECTED]> writes: > in the mean time I've traced the problem down to a 'CONSTRAINT' declared > as 'DEFERRABLE INITIALLY DEFERED'. As soon as I remove that constraint > the transaction commits nicely. BTW: I'm running in ISOLATION LEVEL > SERIALIZABLE, if that matter

Re: [GENERAL] unknown error message

2006-07-24 Thread Markus Schiltknecht
Hello Tom, in the mean time I've traced the problem down to a 'CONSTRAINT' declared as 'DEFERRABLE INITIALLY DEFERED'. As soon as I remove that constraint the transaction commits nicely. BTW: I'm running in ISOLATION LEVEL SERIALIZABLE, if that matters. Has something changed so that it's wor

Re: [GENERAL] Why can't I connect to postgres?

2006-07-24 Thread John DeSoi
On Jul 24, 2006, at 12:57 PM, Theodore H. Smith wrote: Well I tried NaviCat and some others, they seem to work. Perhaps the problem was with REALbasic. I don't know the details of REALBasic, but perhaps it uses ODBC or some other "generic" connection method. In this case, you probably ha

Re: [GENERAL] Why can't I connect to postgres?

2006-07-24 Thread Raymond O'Donnell
On 24 Jul 2006 at 17:57, Theodore H. Smith wrote: > Say for example, I want to do something to the database, can I just > say something like DataBasePleaseTryRegisterUser( "name", "details", > "serial", "etc" ); where DataBasePleaseTryRegisterUser would be some > kind of function stored in t

Re: [GENERAL] unknown error message

2006-07-24 Thread Tom Lane
Markus Schiltknecht <[EMAIL PROTECTED]> writes: > I'm getting the following error from my python script, which tries to > insert lots of data in one transaction: > libpq.OperationalError: ERROR: failed to fetch new tuple for AFTER trigger That's not supposed to happen. Can you provide a test ca

Re: [GENERAL] Why can't I connect to postgres?

2006-07-24 Thread Theodore H. Smith
Well I tried NaviCat and some others, they seem to work. Perhaps the problem was with REALbasic. I can connect via perl, also, which is good. What's a good way to store the database logic? Say for example, I want to do something to the database, can I just say something like DataBasePleas

[GENERAL] unknown error message

2006-07-24 Thread Markus Schiltknecht
Hi, I'm getting the following error from my python script, which tries to insert lots of data in one transaction: libpq.OperationalError: ERROR: failed to fetch new tuple for AFTER trigger I have several AFTER triggers in place, which one raises this error? I'm sure I only INSERT data, no U

Re: [GENERAL] Why can't I connect to postgres?

2006-07-24 Thread John DeSoi
On Jul 24, 2006, at 11:21 AM, Theodore H. Smith wrote: I just installed Postgres for Mac. Also, where is a nice browser/editor for postgres? Something like the OpenBase manager, but for Postgres. Something friendly and neat and simple. I'm sick of all these stupid syntax errors making me

[GENERAL] Why can't I connect to postgres?

2006-07-24 Thread Theodore H. Smith
I just installed Postgres for Mac. Also, where is a nice browser/editor for postgres? Something like the OpenBase manager, but for Postgres. Something friendly and neat and simple. I'm sick of all these stupid syntax errors making me spend half a day doing something I could do in 1 minute.

[GENERAL] What about pgtclsh

2006-07-24 Thread maxime . delaunay
Hello everybody, I must replace an old server by a new one, and I decide to upgrade postgresql 7.1.3 to 8.1.4. But a lot of web script use a program name pgtclsh. I try to find somes informations about it on the web, but all the information that I find was for the older version thant 8. Someone h

Re: [GENERAL] Plperl return_next and bytea binary data?

2006-07-24 Thread Martijn van Oosterhout
On Mon, Jul 24, 2006 at 11:43:39AM +0200, Philippe Lang wrote: > The problem seems to come from the return_next, in conjunction with binary > data: > > > return_next > ( > { > val => $_[0] * $_[1], > image => $im->gif(

[GENERAL] Plperl return_next and bytea binary data?

2006-07-24 Thread Philippe Lang
Hi, I'm trying to generate graphics dynamically from a plperl function, like this: CREATE OR REPLACE FUNCTION test_gd ( IN aint4, IN bint4, OUT val int4, OUT image