[GENERAL] drop view and recreate - for sync

2009-10-23 Thread Sydney Puente
Hello, I have a requirement to pull 2 tables of data from an unreliable db and stash the data in postgres on redhat. Dont imagine the initial load will be be too difficult, gonna use perl DBD to get the data. 100 000 records in total , 10 -15 fields. needs sync-ing regularly - every 12 hours

[GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Kareem Sedki
Hello all, I am trying to write a function that takes one source and one target data type identifiers, each as a '/text/' variable, as arguments and return true if the cast can be made, false otherwise. I consulted the pg_cast and pg_type tables, however, I found no direct casts from 'int4' to

Re: [GENERAL] postgres doesn't start after crash

2009-10-23 Thread Craig Ringer
Sam Jas wrote: Did you find what the reason of crash was? Log seems that the data is corrupted as the system was crashed. The permission denied error would suggest that if anything was corrupted, it was file-system metadata. That shouldn't happen on NTFS, though. It's more likely that for

Re: [GENERAL] FATAL error could not find function alt_to_mic in file cyrillic_and_mic.so

2009-10-23 Thread Jayaraman, Rajaram (STSD)
Thanks Tom, I replaced the file conversion_create.sql and the db got created. In the mean while I got into a different problem, I guess this is also a settings related problem. When I try to connect to the DB and perform insert/update/delete/select operations from the command line all seems

Re: [GENERAL] FATAL error could not find function alt_to_mic in file cyrillic_and_mic.so

2009-10-23 Thread Jayaraman, Rajaram (STSD)
Hi Just Wanted to add we are using PQconnectdb to connect to the database. The contents in pg_hba.conf, just in case it helps. # TYPE DATABASEUSERIP-ADDRESSIP-MASK METHOD local all allmd5 # IPv4-style local

Re: [GENERAL] Incompatible library : Missing Magic Block

2009-10-23 Thread Craig Ringer
Massa, Harald Armin wrote: Ambarsih, // add.cpp : Defines the entry point for the DLL application. are you sure that you using the C-Compiler and not the c++ compiler? As much as I know about defaults, that will be a C++ compiled function, which is something totally different then a C

Re: [GENERAL] FATAL error could not find function alt_to_mic in file cyrillic_and_mic.so

2009-10-23 Thread Craig Ringer
Jayaraman, Rajaram (STSD) wrote: I have compiled PostgreSQL version 8.4.1 on HPUX 11iV3 (HPUX 11.31) on a ia64 hp server BL870c. When I try to start the database it creates the data directory and while initializing it gets till creating conversions and then throws a FATAL error “could not

Re: [GENERAL] auto-filling a field on insert

2009-10-23 Thread Craig Ringer
semi-ambivalent wrote: At first blush that looks good but I need an index on that concatted value and I don't seem to be able to index a field in a view. I'll check the docs on views to see if I'm missing something. As others have noted, a multi-field index or a functional index is probably

Re: [GENERAL] leak in libpq, getpwuid

2009-10-23 Thread Craig Ringer
Michael Nacos wrote: I have just run some tests, the number of lost bytes is always 292, no matter how many connections are opened and closed. I guess it's ok, then. Search the archives for a detailed explanation of this issue. The earlier discussion was about a supposed leak in ecpg. See:

Re: [GENERAL] leak in libpq, getpwuid

2009-10-23 Thread Michael Nacos
thanks... I guess if it really mattered it would have come up by now (since so many interfaces are based on libpq) toying with the idea of yet another one :-)

[GENERAL] Interpreting content of wal

2009-10-23 Thread Charles-Antoine Guillat-Guignard
Hi list, I need to recover the content of WAL files, in order to see what happened to a database, so I am trying to translate it from binary to human-readable log. My goal is to be able to read the modifications that were made to my database (the same way mysqlbinlog does for MySQL). I tried

Re: [GENERAL] Right Join Question

2009-10-23 Thread Little, Douglas
Andrew, I think you want a full outer join. If I understood correctly, you want all real data, plus all codes without data. Doug -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Scott Marlowe Sent: Thursday,

Re: [GENERAL] FATAL error could not find function alt_to_mic in file cyrillic_and_mic.so

2009-10-23 Thread Craig Ringer
Please reply to the list, not just to me. My reply follows inline. Jayaraman, Rajaram (STSD) wrote: I replaced the file conversion_create.sql and the db got created. Yes, but you never found out why it happened in the first place. I strongly suspect your install is busted, probably due to an

Re: [GENERAL] Interpreting content of wal

2009-10-23 Thread Craig Ringer
Charles-Antoine Guillat-Guignard wrote: Hi list, I need to recover the content of WAL files, in order to see what happened to a database, so I am trying to translate it from binary to human-readable log. My goal is to be able to read the modifications that were made to my database (the same

Re: [GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Merlin Moncure
On Fri, Oct 23, 2009 at 4:38 AM, Kareem Sedki isiscreat...@gmail.com wrote: Hello all, I am trying to write a function that takes one source and one target data type identifiers, each as a 'text' variable, as arguments and return true if the cast can be made, false otherwise. I consulted

Re: [GENERAL] Data migration tool certification

2009-10-23 Thread Cjkalbente
Hi, The Talend certification is available to all users including any individuals. You just need to have thorough knowledge on Talend. Pricewise, the Talend certification is free: you will need to take a test on the Internet. hfdabler wrote: Hello to all, I have been using Talend

Re: [GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Tom Lane
Kareem Sedki isiscreat...@gmail.com writes: I am trying to write a function that takes one source and one target data type identifiers, each as a '/text/' variable, as arguments and return true if the cast can be made, false otherwise. I think this is fundamentally the wrong approach, because

[GENERAL] pg 8.4 (Auto)-vacuumlo

2009-10-23 Thread Richard Broersma
I wanted to verify that the auto-vacuum mechanism of postgres doesn't apply to lo objects. Does vocuumlo still need to be called manually? -- Regards, Richard Broersma Jr. Visit the Los Angeles PostgreSQL Users Group (LAPUG) http://pugs.postgresql.org/lapug -- Sent via pgsql-general mailing

Re: [GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Kareem Sedki
Thank you Merlin and Tom. I appreciate your answers. I have tried to follow that approach before I go this way. So, I checked the appendix of the documentation for error conditions. Searching for cast-related conditions, I found INVALID_CHARACTER_VALUE_FOR_CAST. Would that be the exception to

Re: [GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Tom Lane
Kareem Sedki isiscreat...@gmail.com writes: The problem I faced is that the type 'any' is not permitted in procedural languages. If it were permitted, then we could have a function like is_castable( value ANY, target_type TEXT) and then we would catch exceptions if they are thrown. ANYELEMENT

Re: [GENERAL] pg 8.4 (Auto)-vacuumlo

2009-10-23 Thread Alvaro Herrera
Richard Broersma escribió: I wanted to verify that the auto-vacuum mechanism of postgres doesn't apply to lo objects. It doesn't. Does vocuumlo still need to be called manually? Not sure about this. I thought that one was about deleting LOs that were not referenced in any user table. --

Re: [GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Alvaro Herrera
Kareem Sedki escribió: Thank you Merlin and Tom. I appreciate your answers. I have tried to follow that approach before I go this way. So, I checked the appendix of the documentation for error conditions. Searching for cast-related conditions, I found INVALID_CHARACTER_VALUE_FOR_CAST. Would

Re: [GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Merlin Moncure
On Fri, Oct 23, 2009 at 11:14 AM, Kareem Sedki isiscreat...@gmail.com wrote: Thank you Merlin and Tom. I appreciate your answers. I have tried to follow that approach before I go this way. So, I checked the appendix  of the documentation for error conditions. Searching for cast-related

Re: [GENERAL] pg 8.4 (Auto)-vacuumlo

2009-10-23 Thread Richard Broersma
On Fri, Oct 23, 2009 at 8:29 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Does vocuumlo still need to be called manually? Not sure about this.  I thought that one was about deleting LOs that were not referenced in any user table. Thanks this is correct vacuumlo deletes orphaned LOs.

Re: [GENERAL] Incompatible library : Missing Magic Block

2009-10-23 Thread Merlin Moncure
On Fri, Oct 23, 2009 at 7:02 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Massa, Harald Armin wrote: Ambarsih, // add.cpp : Defines the entry point for the DLL application. are you sure that you using the C-Compiler and not the c++ compiler? As much as I know about defaults, that

[GENERAL] Question of using trigger's OLD in EXECUTE

2009-10-23 Thread Nim Li
Hello, I'm new to PostgreSQL and wonder if anyone can help. I'm creating an after-update-trigger for all tables, which copy the old records to a backup table. In my test, the table with this trigger has only two columns - one BIGINT and one VARCHAR. Also I'd like to pass the backup table's

Re: [GENERAL] pg 8.4 (Auto)-vacuumlo

2009-10-23 Thread Tom Lane
Richard Broersma richard.broer...@gmail.com writes: Thanks this is correct vacuumlo deletes orphaned LOs. Right. That functionality is not part of autovacuum --- if you need it you'll still need to run the contrib script occasionally. regards, tom lane -- Sent via

[GENERAL] Error when trying to use pg_dump on 8.3 after minor release update

2009-10-23 Thread Joshua Berry
Greetings, I get the following error when I try to dump a database on a production server: [jbe...@dms dms]$ pg_dump -U dms_user -s dms dms_s.sql pg_dump: SQL command failed pg_dump: Error message from server: ERROR:  could not open relation with OID 27224 pg_dump: The command was: SELECT

Re: [GENERAL] Question of using trigger's OLD in EXECUTE

2009-10-23 Thread Sam Mason
On Fri, Oct 23, 2009 at 11:27:11AM -0400, Nim Li wrote: CREATE OR REPLACE FUNCTION cp_tbl() RETURNS TRIGGER AS $proc$ BEGIN EXECUTE 'INSERT INTO ' || TG_ARGV[0] || ' SELECT ' || OLD; RETURN NEW; END; $proc$ LANGUAGE

[GENERAL] Re: Error when trying to use pg_dump on 8.3 after minor release update

2009-10-23 Thread Joshua Berry
It is a RHEL 5 x86_64 server, running 8.3.7/8 Since the previous backup, we upgraded (via yum) the server from 8.3.7 to 8.3.8 without a restart. Sorry, my facts are wrong: there was no upgrade done on this server. It has been running 8.3.7 compiled from source built and installed on April 1.

Re: [GENERAL] Error when trying to use pg_dump on 8.3 after minor release update

2009-10-23 Thread Tom Lane
Joshua Berry yob...@gmail.com writes: [jbe...@dms dms]$ pg_dump -U dms_user -s dms dms_s.sql pg_dump: SQL command failed pg_dump: Error message from server: ERROR:  could not open relation with OID 27224 pg_dump: The command was: SELECT pg_catalog.pg_get_viewdef('27289'::pg_catalog.oid) as

Re: [GENERAL] Question of using trigger's OLD in EXECUTE

2009-10-23 Thread Nim Li
Thank you Sam!! The code in the posting solves my issue. :) Nim On 10/23/2009 12:07 PM, Sam Mason wrote: On Fri, Oct 23, 2009 at 11:27:11AM -0400, Nim Li wrote: CREATE OR REPLACE FUNCTION cp_tbl() RETURNS TRIGGER AS $proc$ BEGIN EXECUTE 'INSERT INTO ' || TG_ARGV[0]

Re: [GENERAL] Error when trying to use pg_dump on 8.3 after minor release update

2009-10-23 Thread Joshua Berry
On Fri, Oct 23, 2009 at 1:43 PM, Tom Lane t...@sss.pgh.pa.us wrote: This looks like catalog corruption :-(. Can you find a pg_class row with that OID, ie select * from pg_class where oid = 27224 I expect probably not, but then try it with enable_indexscan and enable_bitmapscan turned

Re: [GENERAL] drop view and recreate - for sync

2009-10-23 Thread Vick Khera
On Fri, Oct 23, 2009 at 2:45 AM, Sydney Puente sydneypue...@yahoo.com wrote: This data will be accessed a couple of times a second, and I have a cunning plan to have a view that points to the initial dataload, and then load up the new data into a shadow table, drop the view and then recreate

Re: [GENERAL] Data migration tool certification

2009-10-23 Thread Merlin Moncure
On Fri, Oct 23, 2009 at 8:26 AM, Cjkalbente jkalbe...@yahoo.com wrote: Hi, The Talend certification is available to all users including any individuals. You just need to have thorough knowledge on Talend. Pricewise, the Talend certification is free: you will need to take a test on the

Re: [GENERAL] How to check whether a data type can be cast to another

2009-10-23 Thread Kareem Sedki
Well, actually, yes our work is based on an EAV model. And it has been successful so far. However, the point I was discussing is not really dependent on the EAV model. It is rather dependent on the fact that we are employing an object-oriented design implemented on top of an RDBMS. Regarding, the

[GENERAL] Research and EAV models

2009-10-23 Thread Leif B. Kristensen
I've followed this list for quite a long time, and I think that I've discovered a pattern that I would like to discuss. It seems like there are two camps considering EAV models. On the one hand, there are researchers who think that EAV is a great way to meet their objectives. On the other

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Tom Lane
Leif B. Kristensen l...@solumslekt.org writes: It seems like there are two camps considering EAV models. On the one hand, there are researchers who think that EAV is a great way to meet their objectives. On the other hand, there are the business guys who thnk that EAV is crap. Well, no,

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Peter Hunsberger
On Fri, Oct 23, 2009 at 5:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: Leif B. Kristensen l...@solumslekt.org writes: It seems like there are two camps considering EAV models. On the one hand, there are researchers who think that EAV is a great way to meet their objectives. On the other hand,

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Karsten Hilbert
On Fri, Oct 23, 2009 at 11:53:26PM +0200, Leif B. Kristensen wrote: I'm a researcher type, and I've made an EAV model that suits me well in my genealogy research. How can you associate an essentially unknown number of sundry events to a person without an EAV model? create table person (

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Greg Smith
On Fri, 23 Oct 2009, Leif B. Kristensen wrote: I'm a researcher type, and I've made an EAV model that suits me well in my genealogy research. How can you associate an essentially unknown number of sundry events to a person without an EAV model? CREATE TABLE events(person text,key text,value

[GENERAL] drop view and recreate - for sync

2009-10-23 Thread Sydney Puente
On Fri, Oct 23, 2009 at 2:45 AM, Sydney Puente sydneypue...@yahoo.com wrote: This data will be accessed a couple of times a second, and I have a cunning plan to have a view that points to the initial dataload, and then load up the new data into a shadow table, drop the view and then recreate

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Peter Hunsberger
On Fri, Oct 23, 2009 at 5:30 PM, Greg Smith gsm...@gregsmith.com wrote: Your thinking this is a business/research distinction isn't right, it comes down to the size of the data set and how fast/expressive the queries against them are.  In the research realm, you can watch this struggle play in

[GENERAL] How can I get one OLD.* field in a dynamic query inside a trigger function ?

2009-10-23 Thread Bruno Baguette
Hello ! I'm trying to write a little trigger function with variable arguments quantity (at least one, but can be 2,3,4 arguments). Theses arguments are fields name, so only varchar variable. Since it is a dynamic query, I use the EXECUTE statement as explained on

Re: [GENERAL] How can I get one OLD.* field in a dynamic query inside a trigger function ?

2009-10-23 Thread Pavel Stehule
2009/10/24 Bruno Baguette bruno.bague...@gmail.com: Hello ! I'm trying to write a little trigger function with variable arguments quantity (at least one, but can be 2,3,4 arguments). Theses arguments are fields name, so only varchar variable. Since it is a dynamic query, I use the EXECUTE

Re: [GENERAL] auto-filling a field on insert

2009-10-23 Thread semi-ambivalent
On Oct 23, 5:10 am, cr...@postnewspapers.com.au (Craig Ringer) wrote: semi-ambivalent wrote: At first blush that looks good but I need an index on that concatted value and I don't seem to be able to index a field in a view. I'll check the docs on views to see if I'm missing something. As