Re: [GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-27 Thread David
Looked for that can't find anything and there is no reason why someone would have added that. On Tue, Apr 28, 2009 at 08:24:46AM +0200, A. Kretschmer wrote: > In response to David : > > Our internal task database is doing something odd in that the sequence is > > incrementing by 2 instead of 1 a

Re: [GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-27 Thread A. Kretschmer
In response to 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 num

[GENERAL] Prepare / Execute Method Error

2009-04-27 Thread Brad Budge
I'm having problems passing in variables into my execute statement. Any ideas? * * ** *Table:* CREATE TABLE cat.case ( vari character varying(50),--Contains Value ‘BDD1’ htnumeric(4,1) --Contains Value 30.0 ) *Statem

Re: [GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-27 Thread Thomas Kellerer
David, 28.04.2009 07:48: 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 bot

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

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

2009-04-27 Thread Ian Barwick
2009/4/28 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 fol

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

2009-04-27 Thread Tom Lane
"Michael P. Soulier" 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. Yup... > Foreign-

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Scott Marlowe
On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma wrote: > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe > 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 >>  

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 recor

Re: [GENERAL] triggers and execute...

2009-04-27 Thread Richard Broersma
On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe 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 = to_char(new.

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 Scott Marlowe
On Mon, Apr 27, 2009 at 2:32 PM, Scott Marlowe 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 = to_char(new.

[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 page_access_'||part

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

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] 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

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 >

[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] 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 concr

[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] Noob Q: Is the PG database its own source code backup?

2009-04-27 Thread Bill Moran
In response to 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?

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 tab

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

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. http://www.commandprompt.com/blogs/joshua_drake/2009/01/fk_check_enum_or_d

[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. org.postgresql.util.PSQLException:

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 in

[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. org.postgresql.util.PSQLExcepti

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: http://www.po

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

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Jeff Soules
On Mon, Apr 27, 2009 at 2:03 PM, Bill Moran 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 doing?" If the cont

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Bill Moran
In response to Eric Schwarzenbach : > Bill Moran wrote: > > In response to "Robert Pepersack" : > > > > > >> 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. Tec

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Eric Schwarzenbach
Bill Moran wrote: > In response to "Robert Pepersack" : > > >> 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 "obj

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 wrote: > Whit Armstrong 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 >> constrai

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

2009-04-27 Thread Tom Lane
Whit Armstrong 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: "pg_class_oid_index" UNIQUE, bt

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 implemen

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 > wrote: > > 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. >

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

2009-04-27 Thread Tom Lane
Kynn Jones writes: > On Mon, Apr 27, 2009 at 11:10 AM, Martijn van Oosterhout > wrote: >> 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 contradicts the experience I

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

2009-04-27 Thread Tom Lane
Whit Armstrong 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, atttypid from pg_attribute whe

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 wrote: > 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

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

2009-04-27 Thread Tom Lane
"Michael P. Soulier" 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 left unprocessed trigg

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 examp

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 s

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] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Bill Moran
In response to "Robert Pepersack" : > 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". But then again, C isn't

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

2009-04-27 Thread Michael P. Soulier
Michael P. Soulier wrote: > my $sql =< 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; > UPD

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

2009-04-27 Thread Tom Lane
Whit Armstrong 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 need to look at the underl

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 4/27/2009 10:35 AM >>> In response to "Robert Pepersack" : > Hi, >

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

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

2009-04-27 Thread Tom Lane
"Michael P. Soulier" 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 go through.

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

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 determ

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

[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 Richard Broersma
On Mon, 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 might be incorrect in my thinking about what makes PostgreSQL "Object-Relational", but my understanding is that table inheritance is the f

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Bill Moran
In response to "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-or

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread Grzegorz Jaśkiewicz
On Mon, Apr 27, 2009 at 3:00 PM, Robert Pepersack 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 PostgreSQL database that he calls

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

[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

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