[GENERAL] Large XML file

2008-12-15 Thread Letinarh
I have a large XML file (about 130 Mb) and I want to parse it using plpg/sql. here comes two questions: 1. How can I upload it? (only by means of `Large Object`?) 2. How can I parse it without uploading it. assuming that xml file and postgresql are located on the same server.

Re: [GENERAL] application readable error message

2008-12-15 Thread SunWuKung
On Dec 14, 9:31 pm, r...@iol.ie ("Raymond O'Donnell") wrote: > On 13/12/2008 19:13, SunWuKung wrote: > > I suppose it depends on your development language/environment I use > Delphi a lot, and exceptions contain the error message. Sure, but it would mean parsing the text of the error messages

Re: [GENERAL] Large XML file

2008-12-15 Thread Peter Eisentraut
Letinarh wrote: I have a large XML file (about 130 Mb) and I want to parse it using plpg/sql. here comes two questions: 1. How can I upload it? (only by means of `Large Object`?) You can just insert it normally using INSERT or whatever other method you use for getting data into the database.

[GENERAL] Releasing new version of PostgreSQL Live CD

2008-12-15 Thread Devrim GÜNDÜZ
Hi, I updated my live CD, and it is now based on Fedora 10 and PostgreSQL 8.3.5, with all the PostgreSQL packages that I build on http://yum.pgsqlrpms.org . This new version includes many new packages, and also many updates to the existing packages. Details are here: http://yum.pgsqlrpms.org/li

Re: [GENERAL] Releasing new version of PostgreSQL Live CD

2008-12-15 Thread Devrim GÜNDÜZ
On Mon, 2008-12-15 at 10:50 +0200, Devrim GÜNDÜZ wrote: > Please let me know if you have ...any questions regarding this live CD. Regards, -- Devrim GÜNDÜZ, RHCE devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org signature.asc Descrip

[GENERAL] PostgreSQL installation

2008-12-15 Thread Shahbaz A. Tyagi
Hi, How can we make PostgreSQL db up and running with out using installer i.e. we want to build the db internally and ship the db along with our application and let our application run the DB. We don't want to include the PostgreSQL installer along with our installer and create the db while

Re: [GENERAL] PostgreSQL installation

2008-12-15 Thread Raymond O'Donnell
On 15/12/2008 13:03, Grzegorz Jaśkiewicz wrote: > unless you want to do it on windows, than I have no idea... There's a silent installation option to the Windows installer which AFAIK is the usual way to install Postgres via another installer. Ray. -

Re: [GENERAL] Is index enough to do simple fetch, or table is always used too?

2008-12-15 Thread Merlin Moncure
On Sun, Dec 14, 2008 at 4:15 PM, David Rowley wrote: > The index does not know if the row is dead or alive to the current > transaction. This is only known by the heap. So for your example query > to execute, it may be possible to scan the index but the heap will > need to be checked to see if the

Re: [GENERAL] PostgreSQL installation

2008-12-15 Thread Merlin Moncure
On Mon, Dec 15, 2008 at 7:36 AM, Shahbaz A. Tyagi wrote: > How can we make PostgreSQL db up and running with out using installer i.e. > we want to build the db internally and ship the db along with our > application and let our application run the DB. We don't want to include the > PostgreSQL inst

Re: [GENERAL] PostgreSQL installation

2008-12-15 Thread Raymond O'Donnell
On 15/12/2008 12:59, Grzegorz Jaśkiewicz wrote: > install binaries, If it's on Windows, there may be some registry keys to be set as well...at least, such keys exist on my laptop (XP), but I can't tell whether they belong to PG itself or to the installer. Ray. --

[GENERAL] View vs Constantly Updated Table

2008-12-15 Thread Ketema Harris
if i have a "column" that is a calculation, say a bank balance -> sum of all the debits and credits...is it more efficient to make a view that executes the underlying calc query doing the math, or to create a table that has a column called balance that is updated for each transaction? so

Re: [GENERAL] View vs Constantly Updated Table

2008-12-15 Thread Raymond O'Donnell
On 15/12/2008 16:14, Ketema Harris wrote: > if i have a "column" that is a calculation, say a bank balance -> sum of > all the debits and credits...is it more efficient to make a view that > executes the underlying calc query doing the math, or to create a table > that has a column called balance t

Re: [GENERAL] View vs Constantly Updated Table

2008-12-15 Thread Adam Rich
> if i have a "column" that is a calculation, say a bank balance -> sum > of all the debits and credits...is it more efficient to make a view > that executes the underlying calc query doing the math, or to create a > table that has a column called balance that is updated for each > transaction? >

[GENERAL] Setting NEW in AFTER trigger

2008-12-15 Thread Robert Fitzpatrick
Is it not possible to set the value of a field by reference of NEW.field in an AFTER trigger? I have a trigger where I set NEW.field := myfunction and NEW.field shows the resulting value in my RAISE NOTICE as shown here... CREATE OR REPLACE FUNCTION "public"."registrants_tr_test_func" () RETURNS

[SOLVED] Re: [GENERAL] from 2 keys to serial

2008-12-15 Thread Ivan Sergio Borgonovo
On Sun, 14 Dec 2008 20:16:35 +0100 Ivan Sergio Borgonovo wrote: The cleanest solution I was able to find was to redefine the addresses_temp table so that it uses the same sequence as the _dest table. Some general design advices would be still welcome. > I've to import something whose schema loo

Re: [GENERAL] PostgreSQL installation

2008-12-15 Thread Grzegorz Jaśkiewicz
On Mon, Dec 15, 2008 at 12:36 PM, Shahbaz A. Tyagi wrote: > > > Hi, > > > > How can we make PostgreSQL db up and running with out using installer i.e. > we want to build the db internally and ship the db along with our > application and let our application run the DB. We don't want to include the

Re: [GENERAL] Setting NEW in AFTER trigger

2008-12-15 Thread Tom Lane
Robert Fitzpatrick writes: > Is it not possible to set the value of a field by reference of NEW.field > in an AFTER trigger? An AFTER trigger can't retroactively affect the update that already happened, if that's what you're imagining this would do. Use a BEFORE trigger if you want to affect wha

Re: [GENERAL] PostgreSQL installation

2008-12-15 Thread Grzegorz Jaśkiewicz
unless you want to do it on windows, than I have no idea... -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Relational database design book

2008-12-15 Thread Chris Browne
rshep...@appl-ecosys.com (Rich Shepard) writes: > > [2] Strangely enough -- to me, at least -- the lack of full support for > date- and time-based SQL in database tools such as PostgreSQL is puzzling. > Virtually all business-related databases (think accounting systems as a > prime example) depend

[GENERAL] Trigger/Rules Order of operations

2008-12-15 Thread Ketema Harris
I am interested in finding out the pros, cons, pitfalls of using the following design: Manual insert into Table A. Table A has a BEFORE INSERT trigger that causes an insert to table B. Table B has an AFTER INSERT trigger that causes an insert back to table A (With different criteria not an en

[GENERAL] How restrict select on a view ?

2008-12-15 Thread Andreas
Hi, I'd like to have a view only to be used by certain users. The tables are public. Can this only be done by restricting access to the tables? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-ge

Re: [GENERAL] View vs Constantly Updated Table

2008-12-15 Thread Ketema
On Dec 15, 11:25 am, r...@iol.ie ("Raymond O'Donnell") wrote: > On 15/12/2008 16:14, Ketema Harris wrote: > > > if i have a "column" that is a calculation, say a bank balance -> sum of > > all the debits and credits...is it more efficient to make a view that > > executes the underlying calc query d

[GENERAL] how to load text file that has embeded nul character

2008-12-15 Thread Sun Dong
Hi there, I have to use copy command to load a text file. One of the filed contains an embeded nul character. as shown in the attached file. When I tried to load it, I always get this error: invalid byte sequence for encoding "UTF8": 0x00 how could I load this into postgresql database? Th

Re: [GENERAL] Query Question (one group by vs two separate)

2008-12-15 Thread Jonathon Suggs
Thanks Joris. I'm familiar with explain and I do use it quite frequently. My site is just starting out so I don't think performance is that crucial of an issue at the onset (premature optimization). Also, there is not that much data yet so its difficult to have a very accurate picture of what a

Re: [GENERAL] [ADMIN] Urgente error in restore prod

2008-12-15 Thread Jaime Casanova
On Sun, Dec 14, 2008 at 10:39 AM, paulo matadr wrote: > Hi guys, i need urgent help with this error: > pg_restore: [archiver (db)] error returned by PQputCopyData: cannot allocate > memory for output buffer > im my restore . > any idea with solve this error? if you still have this error can you s

Re: [GENERAL] How restrict select on a view ?

2008-12-15 Thread Raymond O'Donnell
On 15/12/2008 17:55, Andreas wrote: > I'd like to have a view only to be used by certain users. > The tables are public. It doesn't seem to make a lot of sense to have public access to the tables but restrict access to the views. The usual pattern is the other way around - restrict access to the

Re: [GENERAL] Relational database design book

2008-12-15 Thread Raymond O'Donnell
On 15/12/2008 15:09, Chris Browne wrote: > PostgreSQL has pretty nice time types between the timestamptz type and > interval. Yeah... I've often gotten really frustrated trying to do date- and time-related stuff in PHP - it's much easier to get PG to do it instead. :-) Ray.

Re: [GENERAL] Relational database design book

2008-12-15 Thread Brent Wood
It might be useful to look at the capabilities of the Informix Timeseries Datablade (http://www-01.ibm.com/software/data/informix/blades/) if you want to look at ways of enhancing the temporal data capabilities of Postgres. Cheers, Brent Brent Wood DBA/GIS consultant NIWA, Wellington Ne

Re: [SOLVED] Re: [GENERAL] from 2 keys to serial

2008-12-15 Thread George Pavlov
instead of redefining the table (and ending up with two tables pointing to the same sequence) you could also just call nextval() on the target sequence when inserting into your temp table -- pretty much the same thing but seems a bit cleaner. insert into adresses_temp select userid, addressid,

[GENERAL] Create Language Error

2008-12-15 Thread jakot05
Hi! Im trying to install sql-ledger but I got: ERROR: language "plpgsql" does not exist HINT: Use CREATE LANGUAGE to load the language into the database ...then I use CREATE LANGUAGE, but; postgres=# CREATE LANGUAGE pgpsql postgres-# ; ERROR: unsupported language «pgpsql» HINT: The supported lan

Re: [GENERAL] Create Language Error

2008-12-15 Thread Adrian Klaver
On Monday 15 December 2008 6:24:50 pm jakot05 wrote: > Hi! > > Im trying to install sql-ledger but I got: > ERROR: language "plpgsql" does not exist > HINT: Use CREATE LANGUAGE to load the language into the database > > ...then I use CREATE LANGUAGE, but; > > postgres=# CREATE LANGUAGE pgpsql plpg

Re: [GENERAL] How restrict select on a view ?

2008-12-15 Thread Klint Gore
Andreas wrote: I'd like to have a view only to be used by certain users. The tables are public. Can this only be done by restricting access to the tables? GRANT/REVOKE works on views revoke all on aview from public; grant select on aview to user1; As Raymond pointed out, if user2 knows wha

Re: [GENERAL] tup_returned/ tup_fetched

2008-12-15 Thread Sebastian Böhm
sorry I was not very precise. My question is what does it actually mean in the end for these two functions: pg_stat_get_db_tuples_returned(oid) bigint Number of tuples returned for database pg_stat_get_db_tuples_fetched(oid) bigint Number of tuples fetched for database I read the descri

Re: [GENERAL] Create Language Error

2008-12-15 Thread jakot05
On Tue, Dec 16, 2008 at 12:41 AM, jakot05 wrote: > > On Mon, Dec 15, 2008 at 11:32 PM, Klint Gore wrote: > >> jakot05 wrote: >> >>> postgres=# CREATE LANGUAGE pgpsql >>> postgres-# ; >>> ERROR: unsupported language «pgpsql» >>> HINT: The supported languages are listed in the pg_pltemplate >>> >>

[GENERAL] Lost password

2008-12-15 Thread Martin Roach
Hi   I started the installation of postrgres got distracted and then started again but forgot my password. I have received the info below:   Now what? If you have access to shell account on the machine PostgreSQL is running, and your shell works as the same user as Postgres itself, or root - sol