Re: [GENERAL] Rules to provide a virtual column

2008-05-07 Thread Albe Laurenz *EXTERN*
James B. Byrne wrote: > The situation is this. A dependent table relationship is episodic. In other > words, a product might be available for a period of time, then not available, > then available again. Or, a firm might be a client for a period, then not, > then again. Or a person might be an

Re: [GENERAL] ERROR: could not open relation

2008-05-07 Thread Zdenek Kotala
Q Master napsal(a): I get this strange error Caused by: org.postgresql.util.PSQLException: ERROR: could not open relation 1663/53544/58374: No such file or directory How do I recover from it ? Version 8.2 on windows. I think I had an hardware issue in the past where my box rebooted few time

Re: [GENERAL] ERROR: could not open relation

2008-05-07 Thread Gurjeet Singh
On Wed, May 7, 2008 at 1:50 PM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: > Q Master napsal(a): > > > I get this strange error > > > > Caused by: org.postgresql.util.PSQLException: ERROR: could not open > > relation 1663/53544/58374: No such file or directory > > > > How do I recover from it ? Vers

Re: [GENERAL] ERROR: could not open relation

2008-05-07 Thread Zdenek Kotala
Gurjeet Singh napsal(a): The query should be select * from pg_class where relfienode = 58374 Yeah, of course. Thanks Zdenek -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-g

Re: [GENERAL] Is this possible in a trigger?

2008-05-07 Thread hubert depesz lubaczewski
On Tue, May 06, 2008 at 05:05:37PM -0400, Fernando wrote: > I want to keep a history of changes on a field in a table. This will be > the case in multiple tables. http://pgfoundry.org/projects/tablelog/ depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid D

[GENERAL] How to run regression tests on windows

2008-05-07 Thread SatheeshKumar Mohan
Hi, I am new to postgresql. I have postgresql-server (8.1.11) installed on my machine (Windows). What steps should i follow to run the regression and performance tests? /skumar -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://ww

Re: [GENERAL] Is this possible in a trigger?

2008-05-07 Thread valgog
On May 6, 11:05 pm, [EMAIL PROTECTED] (Fernando) wrote: > I want to keep a history of changes on a field in a table.  This will be > the case in multiple tables. > > Can I create a trigger that loops the OLD and NEW values and compares > the values and if they are different creates a change string

[GENERAL] Import German Decimal Numbers

2008-05-07 Thread Jan Christian Dittmer
Hi! I want to import some data from an ascii file using the COPY sql-command. Unfortunatly the decimal numbers are given in german format, meaning the decimal point is replaced by a comma (, instead of .). Is there any possiblility to switch the clients behaviourr (like 'set datestyle') for int

Re: [GENERAL] bytea and character encoding when inserting escaped literals

2008-05-07 Thread Raymond O'Donnell
On 05/05/2008 16:07, Lee Feigenbaum wrote: INSERT INTO myTable VALUES (..., E'\x15\x1C\x2F\x00\x02...', ...) ; As I understand it, the octets need to be entered as their octal representation - have a look at table 8-7 at http://www.postgresql.org/docs/8.3/static/datatype-binary.html. HTH,

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread A. Kretschmer
am Wed, dem 07.05.2008, um 14:25:13 +0200 mailte Jan Christian Dittmer folgendes: > Hi! > > I want to import some data from an ascii file using the COPY sql-command. > Unfortunatly the decimal numbers are given in german format, meaning the > decimal point is replaced by a comma (, instead of .)

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Ken Allen
I would replace the ',' with something else such as a '#' first then replace the decimal with the ',' then replace the '#' with a decimal '.' If you do the ',' with a '.' first then all of them will be '.' and you wont know which ones to change. -Original Message- From: [EMAIL PROTECTED]

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Jan Christian Dittmer
Thank you very much! You have remind me that the our server runs under Linux and not under Windows as our clients :-) So indeed I can use a sed-pipe construct to switch '.' and ','. But wait, there is just another problem then. Our date format is also german :-( "DD.MM.YY" or "DD.MM.". So i

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Ken Allen
Well if your doing an update, do it column by column and when you do a date column replace the '.' with '/' -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jan Christian Dittmer Sent: Wednesday, May 07, 2008 10:16 AM To: pgsql-general@postgresql.org Subje

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Tino Wildenhain
Jan Christian Dittmer wrote: Thank you very much! You have remind me that the our server runs under Linux and not under Windows as our clients :-) So indeed I can use a sed-pipe construct to switch '.' and ','. But wait, there is just another problem then. Our date format is also german :-( "D

Re: [GENERAL] Is this possible in a trigger?

2008-05-07 Thread Fernando
Thank you for your answer. I guess I better create this history in the application's data class. Klint Gore wrote: Fernando wrote: I want to keep a history of changes on a field in a table. This will be the case in multiple tables. Can I create a trigger that loops the OLD and NEW values a

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Thomas Pundt
On Mittwoch, 7. Mai 2008, Jan Christian Dittmer wrote: | The (current) file is 1.4 GB so it will take ages to let awk chew on it | I guess. If you think awk is a bottleneck, I'd recommend using perl instead. It's waaay faster and should process your file within minutes if not faster. Ciao, Thomas

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Tino Wildenhain
Thomas Pundt wrote: On Mittwoch, 7. Mai 2008, Jan Christian Dittmer wrote: | The (current) file is 1.4 GB so it will take ages to let awk chew on it | I guess. If you think awk is a bottleneck, I'd recommend using perl instead. It's waaay faster and should process your file within minutes if not

Re: [GENERAL] Is this possible in a trigger?

2008-05-07 Thread Kerri Reno
Fernando, Below is a function that I hope gets you started. It hasn't been tested, I cut and pasted from our procedure, which is rather more complex. You didn't say what you wanted to do with the changes when you found them, this puts them in a log_audit table. The thing to remember about pytho

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread William Temperley
> Jan Christian Dittmer wrote: > > > >Thank you very much! > >You have remind me that the our server runs under Linux and not under > > Windows as our clients :-) > >So indeed I can use a sed-pipe construct to switch '.' and ','. > >But wait, there is just another problem then. Our

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Tino Wildenhain
William Temperley wrote: ... Bit of a tangent, but Is there any possibility of SQL injection via data provided to copy? depends on how you call COPY, but usually not :-) Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature

[GENERAL] Problems with memory

2008-05-07 Thread Pau Marc Munoz Torres
Hi I'm setting up a big database , and when i say big, i mean BIG, the problem with this is that some times, when a do a query the database run out of memory, so I really need to increase the amount of memory reserved to postgress almost 10x, could anyone tell me how can i do that? i mean, what c

Re: [GENERAL] Problems with memory

2008-05-07 Thread Richard Huxton
Pau Marc Munoz Torres wrote: Hi I'm setting up a big database , and when i say big, i mean BIG, I have to say, I've seen more accurate stats given. How many Terabytes are we talking about? > the problem with this is that some times, when a do a query the database run out of memory, Wha

[GENERAL] Pl/;perl

2008-05-07 Thread George R. C. Silva
Hello All, I´m trying to install pl/perl in my windows machine, but for some reason it just wont work. createlang wont work, create language doesnt work either. i have activeperl 5.1 installed and pgsql 8.3 it returns me this error: 126 unknown - could not load library. any tips? Thanks G

Re: [GENERAL] Pl/;perl

2008-05-07 Thread Craig Ringer
George R. C. Silva wrote: > i have activeperl 5.1 installed and pgsql 8.3 You'll need ActivePerl 5.8 . -- Craig Ringer -- 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] Problems with memory

2008-05-07 Thread Merlin Moncure
On Wed, May 7, 2008 at 11:55 AM, Pau Marc Munoz Torres <[EMAIL PROTECTED]> wrote: > Hi > > I'm setting up a big database , and when i say big, i mean BIG, the problem > with this is that some times, when a do a query the database run out of > memory, so I really need to increase the amount of memo

[GENERAL] pg_dumpall: pg_conversion table not saved

2008-05-07 Thread Michael Enke
Hi list, I updated pg_converion to set the condefault=false where I need it. pg_dumpall does NOT write that table out and therefore it is not possible to restore, this update get lost. Anybody know if this is an error or has an explanation why it has to work this way? Background: I have created

[GENERAL] Problems with memory

2008-05-07 Thread Pau Marc Munoz Torres
Hi I'm setting up a big database , and when i say big, i mean BIG, the problem with this is that some times, when a do a query the database run out of memory, so I really need to increase the amount of memory reserved to postgress almost 10x, could anyone tell me how can i do that? i mean, what c

[GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread John Smith
Hi, I have a large database (multiple TBs) where I'd like to be able to do a backup/restore of just a particular table (call it foo). Because the database is large, the time for a full backup would be prohibitive. Also, whatever backup mechanism we do use needs to keep the system online (i.e., u

Re: [GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread David Wilson
On Wed, May 7, 2008 at 4:02 PM, John Smith <[EMAIL PROTECTED]> wrote: > Does anyone see a problem with this approach (e.g., correctness, > performance, etc.)? Or is there perhaps an alternative approach using > some other postgresql mechanism that I'm not aware of? Did you already look at and

Re: [GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread Joshua D. Drake
On Wed, 7 May 2008 13:02:57 -0700 "John Smith" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a large database (multiple TBs) where I'd like to be able to do > a backup/restore of just a particular table (call it foo). Because > the database is large, the time for a full backup would be > prohibiti

Re: [GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread Joshua D. Drake
On Wed, 7 May 2008 16:09:45 -0400 "David Wilson" <[EMAIL PROTECTED]> wrote: > I'm fairly certain that you have to be very careful about doing simple > file copies while the system is running, as the files may end up out > of sync based on when each individual one is copied. I haven't done it > mys

Re: [GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread Simon Riggs
On Wed, 2008-05-07 at 13:02 -0700, John Smith wrote: > I have a large database (multiple TBs) where I'd like to be able to do > a backup/restore of just a particular table (call it foo). Because > the database is large, the time for a full backup would be > prohibitive. Also, whatever backup mec

Re: [GENERAL] pg_dumpall: pg_conversion table not saved

2008-05-07 Thread Tom Lane
Michael Enke <[EMAIL PROTECTED]> writes: > I updated pg_converion to set the condefault=false where I need it. Why are you needing to replace an existing default conversion? Do we have a bug in it? > pg_dumpall does NOT write that table out and therefore it is not possible to > restore, this upd

Re: [GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread Tom Lane
"John Smith" <[EMAIL PROTECTED]> writes: > After reading the documentation, it seems like the following might > work. Suppose the database has two tables foo and bar, and we're only > interested in backing up table foo: > 1. Call pg_start_backup > 2. Use the pg_class table in the catalog to get

Re: [GENERAL] pg_dumpall: pg_conversion table not saved

2008-05-07 Thread Martijn van Oosterhout
On Wed, May 07, 2008 at 05:38:12PM -0400, Tom Lane wrote: > Michael Enke <[EMAIL PROTECTED]> writes: > > I updated pg_converion to set the condefault=false where I need it. > > Why are you needing to replace an existing default conversion? > Do we have a bug in it? He doesn't really. See his mess

Re: [GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread John Smith
Hi Tom, Actually, I forgot to mention one more detail in my original post. For the table that we're looking to backup, we also want to be able to do incremental backups. pg_dump will cause the entire table to be dumped out each time it is invoked. With the pg_{start,stop}_backup approach, increm

[GENERAL] Custom Base Type in C

2008-05-07 Thread Toby Chavez
I have been trying to created a custom base type in C to use as a state transition variable for some aggregate functions. By following the documentation I haven't been able to do much but crash postgres :) I can compile and run the complex example from the tutorial just fine so I guess that means I

Re: [GENERAL] Custom Base Type in C

2008-05-07 Thread David Wilson
On Wed, May 7, 2008 at 7:06 PM, Toby Chavez <[EMAIL PROTECTED]> wrote: > My custom type needs to have one biginteger and one text value... pretty > straight forward. I guess my first question is if there are any examples out > there that do something similar. I have looked extensively through the

Re: [GENERAL] Custom Base Type in C

2008-05-07 Thread Alvaro Herrera
Toby Chavez escribió: > My custom type needs to have one biginteger and one text value... pretty > straight forward. I guess my first question is if there are any examples out > there that do something similar. I have looked extensively through the > contrib directory and can't find anything very

[GENERAL] Using a composite SQL type in C

2008-05-07 Thread Dan "Heron" Myers
I have a type defined in SQL: CREATE TYPE text_info AS (str text, id integer); I'd like to use this type as the aggregate type in an aggregate function: CREATE FUNCTION foobar(text_info,integer,text,text) RETURNS text_info AS '$libdir/plugins/mylib.dll', 'foobar' LANGUAGE C; CREATE AGGREGATE

Re: [GENERAL] Custom Base Type in C

2008-05-07 Thread Toby Chavez
I need to do the aggregate functions in c not pg/plsql so transition type needs to be accessible in c. If there is a way to do that without explicitly defining the type in c then that would be perfect. > > Is there any particular reason why this needs to be done in C? Why not > just create the typ

Re: [GENERAL] Custom Base Type in C

2008-05-07 Thread Toby Chavez
If I make it pass-by-reference and varlena do I have to worry about TOASTing and deTOASTing everying in my INPUT and OUTPUT functions? On Wed, May 7, 2008 at 5:15 PM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Toby Chavez escribió: > > > My custom type needs to have one biginteger and one text

Re: [GENERAL] Feature request/suggestion - CREATE SCHEMA LIKE

2008-05-07 Thread Bruce Momjian
Added to TODO: o Add CREATE SCHEMA ... LIKE that copies a schema --- [EMAIL PROTECTED] wrote: > On Mar 17, 4:01 pm, wstrzalka <[EMAIL PROTECTED]> wrote: > > Hi > > > >Features like CREATE DATABASE WITH TEMPLATE

Re: [GENERAL] Backup/Restore of single table in multi TB database

2008-05-07 Thread Simon Riggs
On Wed, 2008-05-07 at 15:24 -0700, John Smith wrote: > Actually, I forgot to mention one more detail in my original post. > For the table that we're looking to backup, we also want to be able to > do incremental backups. pg_dump will cause the entire table to be > dumped out each time it is invok

[GENERAL] Ubuntu question

2008-05-07 Thread Q Master
Hello, I had postgresql 7.4 on ubuntu and over one year ago I moved to 8.2 Till now I was backing up my db via pgadmin remotely from windows but now I want to do it from the ubuntu server. When I run the command pgdump it said that the database is 8.2 but the tool is 7.4 - my question is, whe