[GENERAL] Using case expressions in update set clause

2007-10-14 Thread Chris Velevitch
I just want to clarify that the following will always behave the way I think it's supposed to behave:- update tableA set date_field = case when date_field is null then some_date else date_field end; If the current value of date_field for

Re: [GENERAL] reporting tools

2007-10-14 Thread Ned Lilly
On 10/14/2007 6:41 PM Geoffrey wrote: Bill Moran wrote: Geoffrey <[EMAIL PROTECTED]> wrote: Andrus wrote: I guess I should have noted that we will need to run this on Linux clients. Geoffrey, You can run FYIReporting engine in Linux using MONO ( www.go-mono.com ) Thanks, we're looking for s

Re: [GENERAL] Using C API

2007-10-14 Thread Greg Smith
On Tue, 9 Oct 2007, [EMAIL PROTECTED] wrote: following are the rpms I have installed on a RHEL5 system. compat-postgresql-libs-4-2PGDG.rhel4 Yes I see the compat one and will install rhel5 if I find one. It has no bearing on what you were running into, and unless you're having a problem the

[GENERAL] Will UPDATE lock if FROM refers to target table?

2007-10-14 Thread Carlo Stonebanks
If I do an update using the FROM clause, and that clause has a sub-query that refers to the table I am updating, will I be waiting for ever for a table to lock to release? The update before seems to stall, and it occurs to me that perhaps this is the problem. BTW - I rarely do anything but t

Re: [GENERAL] reporting tools

2007-10-14 Thread Geoffrey
Bill Moran wrote: Geoffrey <[EMAIL PROTECTED]> wrote: Andrus wrote: I guess I should have noted that we will need to run this on Linux clients. Geoffrey, You can run FYIReporting engine in Linux using MONO ( www.go-mono.com ) Thanks, we're looking for something that will run natively on Linu

Re: [GENERAL] Importing MySQL dump into PostgreSQL 8.2

2007-10-14 Thread Andrej Ricnik-Bay
On 10/13/07, wido <[EMAIL PROTECTED]> wrote: > hi! but what happens when somebody sent you a dump file and you can't > convert the tables? all i have is a 116MB sql file, and i won't > convert it by hand :P And chances are no one on the list will do it for you, either, specially not when you stick

Re: [GENERAL] reporting tools

2007-10-14 Thread Bill Moran
Geoffrey <[EMAIL PROTECTED]> wrote: > > Andrus wrote: > >> I guess I should have noted that we will need to run this on Linux > >> clients. > > > > Geoffrey, > > > > You can run FYIReporting engine in Linux using MONO ( www.go-mono.com ) > > Thanks, we're looking for something that will run nat

Re: [GENERAL] reporting tools

2007-10-14 Thread Geoffrey
Andrus wrote: I guess I should have noted that we will need to run this on Linux clients. Geoffrey, You can run FYIReporting engine in Linux using MONO ( www.go-mono.com ) Thanks, we're looking for something that will run natively on Linux. -- Until later, Geoffrey Those who would give up

Re: [GENERAL] drop table cascade doesn't drop manual sequences

2007-10-14 Thread Tom Lane
Andreas Kretschmer <[EMAIL PROTECTED]> writes: > Tom Lane <[EMAIL PROTECTED]> schrieb: >> In 8.2 and up you can use ALTER SEQUENCE ... OWNED BY ... to establish a >> link that will make a manually created sequence go away when its "owner" >> column is dropped. In 8.1 that aspect of SERIAL is hidde

Re: [GENERAL] drop table cascade doesn't drop manual sequences

2007-10-14 Thread Andreas Kretschmer
Tom Lane <[EMAIL PROTECTED]> schrieb: > "Scott Marlowe" <[EMAIL PROTECTED]> writes: > > On 10/10/07, Guilherme <[EMAIL PROTECTED]> wrote: > >> If I insert a sequence later on table creation with alter table, drop > >> table cascade simply doesn't drop this sequence even when I specify > >> CASCADE

Re: [GENERAL] can I define own variables?

2007-10-14 Thread Martin Gainty
Good Evening Andreas- Windows Control Panel/System/Advanced/EnvironmentVariables/Set System Variables as mentioned PGHOST=localhost all processes for all users will see these env vars Unix bash (to set system wide variables) go to /etc/profile vi .profile PGHOST=localhost export PGHOST :w! :q

Re: [GENERAL] can I define own variables?

2007-10-14 Thread Andreas
Martin, Can you explain this a little further? My client-application would somehow set the the environment-variable PGUSER e.g. to 42. Then create an odbc connection with user='john' and password='doe' to the remote pg-server. Later the triggers that run on the server would access this client-

Re: [GENERAL] What encoding to use for English, French, Spanish

2007-10-14 Thread Peter Eisentraut
novnov wrote: > My project is currently SQL_ASCII encoded. I will need to accomodate > both French and Spanish in addition to English. I don't anticipate > needing Far East languages. Reading here on the forums I come up with > Latin9 as perhaps adequate. But others recommend unicode for > relative

[GENERAL] What encoding to use for English, French, Spanish

2007-10-14 Thread novnov
My project is currently SQL_ASCII encoded. I will need to accomodate both French and Spanish in addition to English. I don't anticipate needing Far East languages. Reading here on the forums I come up with Latin9 as perhaps adequate. But others recommend unicode for relatively simple needs like my

Re: [GENERAL] drop table cascade doesn't drop manual sequences

2007-10-14 Thread Tom Lane
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > On 10/10/07, Guilherme <[EMAIL PROTECTED]> wrote: >> If I insert a sequence later on table creation with alter table, drop >> table cascade simply doesn't drop this sequence even when I specify >> CASCADE. > This is normal. In 8.2 and up you can use A

Re: [GENERAL] Aggregate View and Conditions taking FOREVER

2007-10-14 Thread Tom Lane
illusina <[EMAIL PROTECTED]> writes: > Ok..I've got a view which returns agency_id, fiscal_year, reporting_month, > count_col0, count_col1...grouping by agency_id, fiscal_year and > reporting_month. Now, if I just select * from myreport; it returns all the > various counts for the various fiscal ye

Re: [GENERAL] Using C API

2007-10-14 Thread Tom Lane
[EMAIL PROTECTED] writes: > I was trying this example program out of a well known postgresql book and > keep getting errors whenever I try to compile. > cc -g -I /usr/include -I /usr/include/pgsql -I /usr/include/pgsql/server > -c -o client1.o client1.c > cc -g client1.o -L /usr/lib -L /usr

Re: [GENERAL] Using C API

2007-10-14 Thread Lars Heidieker
On 10 Oct 2007, at 02:25, [EMAIL PROTECTED] wrote: I was trying this example program out of a well known postgresql book and keep getting errors whenever I try to compile. Error messages ##make client1 cc -g -I /usr/include -I /usr/include/pgsql -I /usr/include/pgsql/ server -c -o client

Re: [GENERAL] atomic commit;begin for long running transactions , in combination with savepoint.

2007-10-14 Thread Trevor Talbot
On 10/14/07, Syan Tan <[EMAIL PROTECTED]> wrote: > I meant commit and continue current transaction. The transaction is opened > on the user application caching composite data from many tables regarding > a root object. Because almost all applications cache data, there is apparently > a pattern "opt

Re: [GENERAL] atomic commit;begin for long running transactions , in combination with savepoint.

2007-10-14 Thread Syan Tan
I meant commit and continue current transaction. The transaction is opened on the user application caching composite data from many tables regarding a root object. Because almost all applications cache data, there is apparently a pattern "optimistic offline lock" where orb middleware basically adds

Re: [GENERAL] drop table cascade doesn't drop manual sequences

2007-10-14 Thread Scott Marlowe
On 10/10/07, Guilherme <[EMAIL PROTECTED]> wrote: > Hello folks, > > I'm new to postgres and I'm using version 8.1 > > Here's the problem anyway: > > If I insert a sequence later on table creation with alter table, drop > table cascade simply doesn't drop this sequence even when I specify > CASCADE

Re: [GENERAL] corrupt database?

2007-10-14 Thread Scott Marlowe
On 10/10/07, vladimir konrad <[EMAIL PROTECTED]> wrote: > > Hello! > > Running postgresql 8.2.5 (build from source on debian testing, amd64) i run > into following error when running "vacuum full analyze": > > ERROR: invalid page header in block 1995925 of relation "data_pkey" Check your hardware

Re: [GENERAL] Importing MySQL dump into PostgreSQL 8.2

2007-10-14 Thread wido
On 5 oct, 01:06, [EMAIL PROTECTED] (Chris) wrote: > Jeff Lanzarotta wrote: > > Hello, > > > I have a MySQL dump file that I would like to import into our PostgreSQL > > 8.2 database. Is there a way to do this? > > You'll need to convert the table definitions then the data. > > For example, mysql ha

[GENERAL] drop table cascade doesn't drop manual sequences

2007-10-14 Thread Guilherme
Hello folks, I'm new to postgres and I'm using version 8.1 Here's the problem anyway: If I insert a sequence later on table creation with alter table, drop table cascade simply doesn't drop this sequence even when I specify CASCADE. works create table bla(id serial); drop

Re: [GENERAL] how to ignore invalid byte sequence for encoding without using sql_ascii?

2007-10-14 Thread detrox yang
got it. thanks very much. On 10/2/07, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > > On Thu, Sep 27, 2007 at 02:28:27AM -0700, [EMAIL PROTECTED] wrote: > > I am now importing the dump file of wikipedia into my postgresql using > > maintains/importDump.php. It fails on 'ERROR: invalid byte s

[GENERAL] replicating to a stopped server

2007-10-14 Thread Joao Miguel Ferreira
Hello, I have a 'strange' situation: I need to make a replica copy of my database to a reduntant spare computer. The reduntant computer is not running postgres, but postgres is installed. The redundant computer is running in a special run-level (I'm talking Linux here) in which Pg is _not_ runni

[GENERAL] db errors

2007-10-14 Thread Akash Garg
We had a crash of one of our db systems last night. After doing a fsck of he file system and getting the db backup, we're getting a lot of these messages in our logs. The DB will also occasionally crash now. Oct 12 07:40:16 postgres[30770]: [3-1] 2007-10-12 07:40:16 PDTERROR: could not access s

[GENERAL] Invalid error message when user has nologin attibute

2007-10-14 Thread Andrus
When user login has disabled by CREATE USER NOLOGIN Postgres 8.2 returns "Password authentication failure" error message on login. This is very confusing to users. How to force Postgres to return message like in Windows: Login is disabled. ? Andrus. ---(end

[GENERAL] extracting multiple results from a set of tuples

2007-10-14 Thread merlino
Hi all, I am writing a few pg/plsql and have no great experience, so i'm asking here. I need to obtain ,,.. from N queryes like these: SELECT FROM tab GROUP BY SELECT FROM tab GROUP BY SELECT FROM tab WHERE C3 GROUP BY [eventually ORDER BY Z3]; example: SELECT count(*),name FROM tab GROUP

[GENERAL] Using C API

2007-10-14 Thread pgsql . gen
I was trying this example program out of a well known postgresql book and keep getting errors whenever I try to compile. Error messages ##make client1 cc -g -I /usr/include -I /usr/include/pgsql -I /usr/include/pgsql/server -c -o client1.o client1.c cc -g client1.o -L /usr/lib -L /usr/lib/

[GENERAL] Aggregate View and Conditions taking FOREVER

2007-10-14 Thread illusina
Background: Ok..I've got a view which returns agency_id, fiscal_year, reporting_month, count_col0, count_col1...grouping by agency_id, fiscal_year and reporting_month. Now, if I just select * from myreport; it returns all the various counts for the various fiscal years and all that within 4 secon

Re: [GENERAL] reporting tools

2007-10-14 Thread Andrus
> I guess I should have noted that we will need to run this on Linux > clients. Geoffrey, You can run FYIReporting engine in Linux using MONO ( www.go-mono.com ) Andrus. ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, pleas

[GENERAL] corrupt database?

2007-10-14 Thread vladimir konrad
Hello! Running postgresql 8.2.5 (build from source on debian testing, amd64) i run into following error when running "vacuum full analyze": ERROR: invalid page header in block 1995925 of relation "data_pkey" The database was freshly initialized and contains around 1.4 billion records in the ma

Re: [GENERAL] SLEEP in posgresql

2007-10-14 Thread Robert Treat
On Wednesday 10 October 2007 01:00, Jasbinder Singh Bali wrote: > I'm using Postgresql Version 8.1.4. on fedora core 6 > I'm pretty sure that pg_sleep is not implemented in 8.1. > Am not sure what is the work around > Yeah can code your own sleep function in plpgsql, but it tends to be resource

[GENERAL] PLPGSQL 'SET SESSION ROLE' problems ..

2007-10-14 Thread Greg Wickham
Hi, Is it possible to change the current role to another arbitrary role using a PLPGSQL function? In essence I've a function "authorise" created by the db superuser with 'SECURITY DEFINER' specificied. However from within plpgsql the 'superuser' attribute isn't honored when trying to change rol

Re: [GENERAL] corrupt database?

2007-10-14 Thread vladimir konrad
> > Any ideas what to do next? Well, I am going to try the same with 8.3 beta1, will see what happens... Vlad ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining

Re: [GENERAL] SLEEP in posgresql

2007-10-14 Thread Harpreet Dhaliwal
I think pg_sleep is not implemented in 8.1 and earlier versions. Is there any alternative if someone is using versions before 8.2 ? On 10/9/07, Guy Rouillier <[EMAIL PROTECTED]> wrote: > > Jasbinder Singh Bali wrote: > > Hi, > > > > I have a while loop and I want to re-iterate after every 't' seco

Re: [GENERAL] Database reverse engineering

2007-10-14 Thread vladimir konrad
> I am trying to use postgresql-autodoc. The autodoc finds all the Perl > modules and compiles but when I go to /usr/local/bin and run > postgresql_autodoc like this I had a good luck with schema-spy (done in java)... http://schemaspy.sourceforge.net/ Vlad ps: the command I use is (all on one

[GENERAL] fmgr_info_cxt_security() modifies variable?

2007-10-14 Thread Luis Vargas
Hi, I'm calling an arbitrary user-defined function from the backend. Although I can do it via FunctionCallInvoke, I have a weird problem when calling fmgr_info. The call results in a argument variable (eventType) being cleared. A gdb hardware watch says that the variable is modified by this lin

Re: [GENERAL] atomic commit;begin for long running transactions , in combination with savepoint.

2007-10-14 Thread Trevor Talbot
On 10/13/07, syan tan <[EMAIL PROTECTED]> wrote: > I was wondering whether there could be an atomic commit;begin command > for postgresql, in order to open up a transaction at the beginning of > a unit of work in a client session, so that client applications don't > have to duplicate work with havi

Re: [GENERAL] Recommended method for creating file of zeros?

2007-10-14 Thread Kevin Hunter
At 2:17a -0400 on 14 Oct 2007, Jason L. Buberel wrote: > create file '00A4' and fill it with 256k zeros. Is there a quick and > easy linux-way of creating such a beast? The tool is 'dd' and /dev. /dev/zero in this case. The summary of what you asked: $ dd if=/dev/zero of=./zblah count=1 bs=256k