[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 't

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

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 to

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 co

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

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 usin

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, October

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 i

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

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 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 the pg_cast and pg

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 Talen

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

2009-10-23 Thread Tom Lane
Kareem Sedki 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 it ignores the quest

[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 l

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 cat

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

2009-10-23 Thread Tom Lane
Kareem Sedki 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 maybe? > Here is

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. W

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 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 conditions, I found INVA

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

2009-10-23 Thread Richard Broersma
On Fri, Oct 23, 2009 at 8:29 AM, Alvaro Herrera 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. -- Regards, Richard

Re: [GENERAL] Incompatible library : Missing Magic Block

2009-10-23 Thread Merlin Moncure
On Fri, Oct 23, 2009 at 7:02 AM, Craig Ringer 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 will be a C++ com

[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 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 pgsql-general mailing list (p

[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 pg_ca

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$ LANGUAG

[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

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

2009-10-23 Thread Tom Lane
Joshua Berry 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 viewdef

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 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 off. If tha

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 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 it > pointing to the

Re: [GENERAL] Data migration tool certification

2009-10-23 Thread Merlin Moncure
On Fri, Oct 23, 2009 at 8:26 AM, Cjkalbente 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 Internet. how

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 hand,

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Tom Lane
"Leif B. Kristensen" 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, it's not that

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Peter Hunsberger
On Fri, Oct 23, 2009 at 5:04 PM, Tom Lane wrote: > "Leif B. Kristensen" 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 wh

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,val

[GENERAL] drop view and recreate - for sync

2009-10-23 Thread Sydney Puente
On Fri, Oct 23, 2009 at 2:45 AM, Sydney Puente 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 it > pointing to the

Re: [GENERAL] Research and EAV models

2009-10-23 Thread Peter Hunsberger
On Fri, Oct 23, 2009 at 5:30 PM, Greg Smith 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 things > like bi

[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 : > 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 explai

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.

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

2009-10-23 Thread Scott Marlowe
On Fri, Oct 23, 2009 at 9:32 PM, semi-ambivalent wrote: > 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'l