Re: [GENERAL] need help for PostgreSQL consistency check mechanism

2009-04-27 Thread Martijn van Oosterhout
On Mon, Apr 27, 2009 at 10:13:47AM +0800, Chen, Dongdong (GE Healthcare) wrote: Checksum is my primitive thought, is there table level checksum? Our objective is like this: If shutdown normally, OK. If shutdown ABNORMALLY, then reboot the OS, check whether there is database records loss or

Re: [GENERAL] Open source and diagramming survey

2009-04-27 Thread Sam Mason
On Sun, Apr 26, 2009 at 08:43:51PM -0400, Martin Gainty wrote: your survey should refrain from collecting demographic information demographic information has no bearing on Computer Science, the Apache community in general or becoming a contributor to the Postgres community Really? How can

[GENERAL] Cannot reattach to shared memory / Windows

2009-04-27 Thread Howard Cole
Hi, I am running postgres 8.3 on a W2K8 server and appear to be getting lots of cannot reattach to shared memory errors in the log. I used to get these before on a windows 2K3 server but I was under the impression that these were caused by ESET NOD32 antivirus software. But I am not running

[GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Robert Pepersack
Hi, Thanks in advance for your help. I have a lot of experience with object-oriented programming and relational databases, but I'm new to PostgreSQL. My agency has a contractor that created a PostgreSQL database that he calls object-oriented. I noticed that the contractor has more than

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Grzegorz Jaśkiewicz
On Mon, Apr 27, 2009 at 3:00 PM, Robert Pepersack rpepers...@mdinsurance.state.md.us wrote: Hi, Thanks in advance for your help. I have a lot of experience with object-oriented programming and relational databases, but I'm new to PostgreSQL. My agency has a contractor that created a

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Bill Moran
In response to Robert Pepersack rpepers...@mdinsurance.state.md.us: Hi, Thanks in advance for your help. I have a lot of experience with object-oriented programming and relational databases, but I'm new to PostgreSQL. My agency has a contractor that created a PostgreSQL database

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Richard Broersma
On Mon, Apr 27, 2009 at 7:00 AM, Robert Pepersack rpepers...@mdinsurance.state.md.us wrote: My agency has a contractor that created a PostgreSQL database that he calls object-oriented. I might be incorrect in my thinking about what makes PostgreSQL Object-Relational, but my understanding is

[GENERAL] Which header and lib files to use when compiling libpq-code?

2009-04-27 Thread Kynn Jones
I need to compile some code that uses libpq. For this I need to determine the directories to use for the header and library files. The machine I'm using has multiple copies of the files libpq-fe.h and libpq.a. How can I determine which one of all these copies are the ones that correspond to the

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Christophe
On Apr 27, 2009, at 7:00 AM, Robert Pepersack wrote: My agency has a contractor that created a PostgreSQL database that he calls object-oriented. I noticed that the contractor has more than one value in a column separated by commas. In the relational world, this obviously violates first

Re: [GENERAL] Which header and lib files to use when compiling libpq-code?

2009-04-27 Thread Martijn van Oosterhout
On Mon, Apr 27, 2009 at 10:51:45AM -0400, Kynn Jones wrote: I need to compile some code that uses libpq. For this I need to determine the directories to use for the header and library files. The machine I'm using has multiple copies of the files libpq-fe.h and libpq.a. How can I determine

[GENERAL] how do you get there from here?

2009-04-27 Thread Michael P. Soulier
I've been working successfully with postgreSQL 7.4 for a while now, and we're now finally picking up a recent version (8.3.5). Unfortunately my existing migration code is failing due to some changes with 8.3. my $sql =EOF; ALTER TABLE instances ADD COLUMN udp_icpside_address_override inet

Re: [GENERAL] how do you get there from here?

2009-04-27 Thread Tom Lane
Michael P. Soulier michael_soul...@mitel.com writes: This worked in 7.4 but fails now with cannot ALTER TABLE instances because it has pending trigger events I think the problem is you're issuing all those commands in one transaction. If you COMMIT the updates then the subsequent ALTERs should

[GENERAL] find column OID types with information schema?

2009-04-27 Thread Whit Armstrong
Is it possible to find out the OID types of the columns of a table using the information schema? I see that I can get the character names of the types using this query: select * from information_schema.columns where table_name = 'my_table'; but I don't see a way to find the actual OID types of

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Robert Pepersack
I read the document on array data types. Do they have anything at all to do with PostgreSQL being object-oriented? Also, these comma-delimited fields make creating reports with our reporting tool impossible. Bill Moran wmo...@potentialtech.com 4/27/2009 10:35 AM In response to Robert

Re: [GENERAL] find column OID types with information schema?

2009-04-27 Thread Tom Lane
Whit Armstrong armstrong.w...@gmail.com writes: Is it possible to find out the OID types of the columns of a table using the information schema? No. Type OIDs are a Postgres-ism so they are not reflected in the standards-mandated contents of the information_schema. If you want OIDs you'll

Re: [GENERAL] how do you get there from here?

2009-04-27 Thread Michael P. Soulier
Michael P. Soulier wrote: my $sql =EOF; ALTER TABLE instances ADD COLUMN udp_icpside_address_override inet DEFAULT NULL; ALTER TABLE instances ADD COLUMN udp_setside_address_override inet DEFAULT NULL; UPDATE instances SET udp_icpside_address_override = $udp_icpside_address_override;

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Bill Moran
In response to Robert Pepersack rpepers...@mdinsurance.state.md.us: I read the document on array data types. Do they have anything at all to do with PostgreSQL being object-oriented? If you want to be pedantic, not really. Technically, Postgres isn't object-oriented, it's object-relational.

Re: [GENERAL] find column OID types with information schema?

2009-04-27 Thread Alvaro Herrera
Whit Armstrong escribió: Is it possible to find out the OID types of the columns of a table using the information schema? No; information_schema is limited to stuff that's defined by the SQL standard. If you want OIDs, you need to extract that stuff from the pg_catalog.* catalogs. Type OIDs

Re: [GENERAL] Cannot reattach to shared memory / Windows

2009-04-27 Thread Bruce Momjian
Howard Cole wrote: Hi, I am running postgres 8.3 on a W2K8 server and appear to be getting lots of cannot reattach to shared memory errors in the log. I used to get these before on a windows 2K3 server but I was under the impression that these were caused by ESET NOD32 antivirus

Re: [GENERAL] find column OID types with information schema?

2009-04-27 Thread Whit Armstrong
(I had accidentally replied to Tom only on my reply) the OID's can be found as follows: SELECT * FROM pg_attribute WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'mytable'); from this page: http://www.postgresql.org/docs/8.3/interactive/datatype-oid.html However, there is no

Re: [GENERAL] how do you get there from here?

2009-04-27 Thread Tom Lane
Michael P. Soulier michael_soul...@mitel.com writes: But I don't understand why this was required. What's wrong with adding a column and copying data into it in a transaction? Nothing. The problem apparently is that you've got deferred AFTER triggers on that table, so the UPDATE commands have

Re: [GENERAL] Which header and lib files to use when compiling libpq-code?

2009-04-27 Thread Kynn Jones
On Mon, Apr 27, 2009 at 11:10 AM, Martijn van Oosterhout klep...@svana.orgwrote: On Mon, Apr 27, 2009 at 10:51:45AM -0400, Kynn Jones wrote: I need to compile some code that uses libpq. For this I need to determine the directories to use for the header and library files. The machine

Re: [GENERAL] find column OID types with information schema?

2009-04-27 Thread Tom Lane
Whit Armstrong armstrong.w...@gmail.com writes: However, there is no example that uses a schema + tablename. If you're into masochism you can do that with a join of pg_class and pg_namespace. But what's usually easier for one-off queries is to use the regclass converter: select attname,

Re: [GENERAL] Which header and lib files to use when compiling libpq-code?

2009-04-27 Thread Tom Lane
Kynn Jones kyn...@gmail.com writes: On Mon, Apr 27, 2009 at 11:10 AM, Martijn van Oosterhout klep...@svana.orgwrote: In general you don't need to match the server version, the protocol hasn't changed much in a while so as long as it's less than a few years old it'll work. This statement

Re: [GENERAL] Which header and lib files to use when compiling libpq-code?

2009-04-27 Thread Martijn van Oosterhout
On Mon, Apr 27, 2009 at 12:27:37PM -0400, Kynn Jones wrote: On Mon, Apr 27, 2009 at 11:10 AM, Martijn van Oosterhout klep...@svana.orgwrote: In general you don't need to match the server version, the protocol hasn't changed much in a while so as long as it's less than a few years old it'll

Re: [GENERAL] find column OID types with information schema?

2009-04-27 Thread Whit Armstrong
Thanks, Tom. I guess the answer is, yes, but perhaps you can help me decide. I'm just reading this part of the documentation from the link I posted: OIDs are not added to user-created tables, unless WITH OIDS is specified when the table is created. and also: The oid type is currently

Re: [GENERAL] find column OID types with information schema?

2009-04-27 Thread Tom Lane
Whit Armstrong armstrong.w...@gmail.com writes: Am I misinterpreting this documentation? Are there cases in which the OID's of two tables will collide? I don't see any uniqueness constraints on the pg_class table. You didn't look too hard: regression=# \d pg_class ... Indexes:

Re: [GENERAL] find column OID types with information schema?

2009-04-27 Thread Whit Armstrong
ok, got it. thanks for the clarification and the hand holding. -Whit On Mon, Apr 27, 2009 at 1:09 PM, Tom Lane t...@sss.pgh.pa.us wrote: Whit Armstrong armstrong.w...@gmail.com writes: Am I misinterpreting this documentation?  Are there cases in which the OID's of two tables will collide?  

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Eric Schwarzenbach
Bill Moran wrote: In response to Robert Pepersack rpepers...@mdinsurance.state.md.us: I read the document on array data types. Do they have anything at all to do with PostgreSQL being object-oriented? If you want to be pedantic, not really. Technically, Postgres isn't

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Bill Moran
In response to Eric Schwarzenbach subscri...@blackbrook.org: Bill Moran wrote: In response to Robert Pepersack rpepers...@mdinsurance.state.md.us: I read the document on array data types. Do they have anything at all to do with PostgreSQL being object-oriented? If you

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Jeff Soules
On Mon, Apr 27, 2009 at 2:03 PM, Bill Moran wmo...@potentialtech.com wrote: Reading between the lines, the original question was: This guy is making my life difficult, and he claims it's for this reason. I read the question more as Did we hire some database contractor who has no idea what he's

[GENERAL] Query organization question

2009-04-27 Thread Gauthier, Dave
I have a poorly performing query that looks something like select x.name, x.title, x.value from (select a.name as name, b.book_title as title, c.cost as value from ..) x where exists (select 'found_it' from get_jobs(x.name) j where j.job = 'carpenter'); I did it this way because I

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread marcin mank
Is there any sane reason to use an array column, besides performance (the values can be read in less disk seeks than in a table-with-a-foreign-key scenario)? Greetings marcin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] Migration from Postgres 7.3 to 8.1.1: Getting No results were returned for function calls

2009-04-27 Thread Sriganesh Ananth
Hello Group, I am in the process of migrating Postgres from version 7.3 to 8.1.1 on the Linux 5 server with JDK 1.6 installed and I am using “postgresql-8.3-604.jdbc4.jar”. When I try to call a Postgres function from my Java code I am receiving the following error.

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Johan Nel
Hi Robert, Inheritance normally are defined in the Object Orientated environment. I however have a different perspective regarding when a database is defined as OO. One of the most common OO-databases that I am familiar with is Intersystems Cache. If for example we look at how PG create

[GENERAL] Postgres 7.3 to 8.1.1 migration: Getting 'No results were returned..' for function calls

2009-04-27 Thread Sriganesh Ananth
Hi Group, I am in the process of migrating Postgres from version 7.3 to 8.1.1 on the Linux 5 server with JDK 1.6 installed and I am using “postgresql-8.3-604.jdbc4.jar”. When I try to call a Postgres function from my Java code I am receiving the following error.

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Joshua D. Drake
On Mon, 2009-04-27 at 20:37 +0200, marcin mank wrote: Is there any sane reason to use an array column, besides performance (the values can be read in less disk seeks than in a table-with-a-foreign-key scenario)? Yes.

[GENERAL] Noob Q: Is the PG database its own source code backup?

2009-04-27 Thread Kenneth Tilton
I find myself hacking away in pgAdmin most of the time now, after early on keeping PG source code in text files I could preserve in SVN. At this point I cannot point to anything other than the pg db itself that has a full description. Is this normal? Or do folks assiduously maintain an

Re: [GENERAL] how do you get there from here?

2009-04-27 Thread Michael P. Soulier
Tom Lane wrote: Nothing. The problem apparently is that you've got deferred AFTER triggers on that table, so the UPDATE commands have left unprocessed trigger events behind, and the system can't be sure that those events would still be sensible to fire after doing further ALTERs on the table.

Re: [GENERAL] Noob Q: Is the PG database its own source code backup?

2009-04-27 Thread Bill Moran
In response to Kenneth Tilton kentil...@gmail.com: I find myself hacking away in pgAdmin most of the time now, after early on keeping PG source code in text files I could preserve in SVN. At this point I cannot point to anything other than the pg db itself that has a full description.

[GENERAL] PostgreSQL Hibernate Problem

2009-04-27 Thread mgazzo
I am new to PostgreSQL and I want to use it from a Java Application with the Hibernate ORM. I ran into a problem when I created my first simple Hello Postegres app where I receive a 'relation X does not exist' error. It turns out that the query Hibernate produces seems to be missing some quotes

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Martin Gainty
if your experience started with a DB that supported Object Relational types such as http://infolab.stanford.edu/~ullman/fcdb/oracle/or-objects.html then it is reasonable to assume you would want to maintain those capabilities can you provide us one testcase we could try to work thru (using

[GENERAL] status of pl/php

2009-04-27 Thread Scott Marlowe
It looks like pl/php is still on a beta release. Is the previous non-beta release preferred, or the beta1 tested against 8.3beta1? -- 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] status of pl/php

2009-04-27 Thread Joshua D. Drake
On Mon, 2009-04-27 at 13:33 -0600, Scott Marlowe wrote: It looks like pl/php is still on a beta release. Is the previous non-beta release preferred, or the beta1 tested against 8.3beta1? Better question for the pl/php list. Copying Alexey because he would know better. Joshua D. Drake --

Re: [GENERAL] status of pl/php

2009-04-27 Thread Alvaro Herrera
Joshua D. Drake escribió: On Mon, 2009-04-27 at 13:33 -0600, Scott Marlowe wrote: It looks like pl/php is still on a beta release. Is the previous non-beta release preferred, or the beta1 tested against 8.3beta1? Better question for the pl/php list. Copying Alexey because he would know

Re: [GENERAL] status of pl/php

2009-04-27 Thread Alexey Klyukin
Hi, On Apr 27, 2009, at 10:44 PM, Joshua D. Drake wrote: On Mon, 2009-04-27 at 13:33 -0600, Scott Marlowe wrote: It looks like pl/php is still on a beta release. Is the previous non-beta release preferred, or the beta1 tested against 8.3beta1? Better question for the pl/php list. Copying

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Alvaro Herrera
Robert Pepersack wrote: My agency has a contractor that created a PostgreSQL database that he calls object-oriented. I noticed that the contractor has more than one value in a column separated by commas. In the relational world, this obviously violates first normal form. When I asked about

[GENERAL] triggers and execute...

2009-04-27 Thread Scott Marlowe
OK, I'm hitting a wall here. I've written this trigger for partitioning: create or replace function page_access_insert_trigger () returns trigger as $$ DECLARE part text; q text; BEGIN part = to_char(new.timestamp,'MMDD'); q = 'insert into

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Scott Marlowe
On Mon, Apr 27, 2009 at 2:32 PM, Scott Marlowe scott.marl...@gmail.com wrote: OK, I'm hitting a wall here.  I've written this trigger for partitioning: create or replace function page_access_insert_trigger () returns trigger as $$ DECLARE        part text;        q text; BEGIN        part

Re: [GENERAL] Query organization question

2009-04-27 Thread Grzegorz Jaśkiewicz
  exists (select ‘found_it’ from get_jobs(x.name) j where j.job = ‘carpenter’); What does this function do ? If it only runs on the tables, than simple join will do it pretty fast. also, keeping job as integer, if table is large will save you some space, make index lookup faster, and generally

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Richard Broersma
On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe scott.marl...@gmail.com wrote: OK, I'm hitting a wall here.  I've written this trigger for partitioning: create or replace function page_access_insert_trigger () returns trigger as $$ DECLARE        part text;        q text; BEGIN        part

Re: [GENERAL] Query organization question

2009-04-27 Thread Gauthier, Dave
The example was fictitious, but the structure is the same as the real problem. The stored procedure calls another recursive stored procedure that can take a long time to run, usually about 3-4 seconds. Not bad for a handful of records, but it is now operating on a table with over 40,000

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Scott Marlowe
On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma richard.broer...@gmail.com wrote: On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe scott.marl...@gmail.com wrote: OK, I'm hitting a wall here.  I've written this trigger for partitioning: create or replace function page_access_insert_trigger ()

Re: [GENERAL] how do you get there from here?

2009-04-27 Thread Tom Lane
Michael P. Soulier michael_soul...@mitel.com writes: Tom Lane wrote: *Why* you've got such triggers is not apparent from what you've told us. I've not explicitely created any triggers. The table has constraints, and if that results in triggers created by the system, then that would be why.

Re: [GENERAL] Noob Q: Is the PG database its own source code backup?

2009-04-27 Thread Ian Barwick
2009/4/28 Kenneth Tilton kentil...@gmail.com: I find myself hacking away in pgAdmin most of the time now, after early on keeping PG source code in text files I could preserve in SVN. At this point I cannot point to anything other than the pg db itself that has a full description. Is this

[GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-27 Thread David
Our internal task database is doing something odd in that the sequence is incrementing by 2 instead of 1 and I can't find any reason why I have checked the sequence itself to see if it had somehow got set to increment by 2 but no. The table in question has a number of both before and after