[GENERAL] postgresql.conf RH comment, and a systemd RH note

2016-08-31 Thread Karl O. Pinc
Hi, FYI, the RH rpm contains the following comment in postgresql.conf, which is not in the postgresql.org rpm. I found it helpful. @@ -61,11 +61,7 @@ # defaults to 'localhost'; use '*' for all # (change requires restart) #port = 5432

Re: [GENERAL] Transitioning to a SQL db

2016-04-08 Thread Karl O. Pinc
Hi Tim, As arranged I am cc-ing the pgsql-general list in the hope they will assist. Your posts to the list may be delayed for moderation, I can't say. It could be helpful if you subscribed to the list, but it is relatively high traffic and I know you have extremely limited and expensive bandwid

[GENERAL] Serializable isolation -- are predicate locks still held across all databases?

2017-05-18 Thread Karl O. Pinc
Hi, I forget all the details, but some time ago I found that I had to increase max_pred_locs_per_transaction. What I recall about the reason for this is that I'm using the serializable transaction isolation, and that I've a test database which occasionally has extremely long running transactions.

Re: [GENERAL] Serializable isolation -- are predicate locks still held across all databases?

2017-05-18 Thread Karl O. Pinc
On Thu, 18 May 2017 12:04:42 -0500 Kevin Grittner wrote: > On Thu, May 18, 2017 at 11:07 AM, Karl O. Pinc wrote: > > > ... Does PG > > now pay attention to database in it's SSI implementation? > > Well, it pays attention as far as the scope of each lock, but th

Re: [GENERAL] Serializable isolation -- are predicate locks still held across all databases?

2017-05-19 Thread Karl O. Pinc
On Fri, 19 May 2017 01:52:00 -0500 "Karl O. Pinc" wrote: > On Thu, 18 May 2017 12:04:42 -0500 > Kevin Grittner wrote: > > > On Thu, May 18, 2017 at 11:07 AM, Karl O. Pinc wrote: > > > > > ... Does PG > > > now pay attention to database

[GENERAL] Request for help with database of Kenyan election violence

2008-02-02 Thread Karl O. Pinc
Hello, The Kenya National Commission for Human Rights is investigating the violence in Kenya. This has led to an urgent request on Groklaw http://www.groklaw.net/article.php?story=20080202013451629 for assistance in setting up a database. I have suggested that a suite of PostgreSQL based tools

[GENERAL] Babase, a PostgreSQL database and an example Foxpro conversion

2008-02-29 Thread Karl O. Pinc
Hello, The Babase project has published the code for it's PostgreSQL based baboon data management database online. Babase may be of interest because it makes extensive use of triggers for data validation and complex data generation; we use many of PostgreSQL's features to push the limits when it

[GENERAL] plpgsql array initialization, what's the story?

2005-03-31 Thread Karl O. Pinc
Postgresql 8.0.1 If I write the plpgsql: declare y int[]; begin y[1] := 1; y[2] := 2; y[3] := 3; ... All y[] array elements are NULL, as is array_dims(y). But if I write: declare y int[] := '{}'; begin y[1] := 1; y[2] := 2; y[3] := 3; ... Then things work as expected. What's going on? (As in "Gosh

[GENERAL] Best practices for (plpgsql ?) trigger optimization?

2005-04-01 Thread Karl O. Pinc
Hi, Are there any best practices for optimizing triggers, and, I suppose, stored procedures as well? I am now starting on optimization and before I begin am hoping to avoid re-inventing the wheel. The problems I see are: 1) There is no way to profile where a problem lies. When there are large and/

Re: [GENERAL] Best practices for (plpgsql ?) trigger optimization?

2005-04-01 Thread Karl O. Pinc
On 04/01/2005 10:19:55 AM, Karl O. Pinc wrote: Hi, Are there any best practices for optimizing triggers, and, I suppose, stored procedures as well? The solutions I see are to use: SET client_min_messages DEBUG1; SET debug_print_plan TRUE; and maybe SET log_executer_stats TRUE; Ok, this strategy

Re: [GENERAL] plpgsql array initialization, what's the story?

2005-04-02 Thread Karl O. Pinc
On 03/31/2005 01:59:02 PM, Michael Fuhr wrote: I think this has been fixed for 8.0.2: http://archives.postgresql.org/pgsql-committers/2005-02/msg00012.php Here's a test in 8.0.2beta1: CREATE FUNCTION foo() RETURNS integer[] AS $$ DECLARE y integer[]; BEGIN y[1] := 1; y[2] := 2; y[3

[GENERAL] Strange plpgsql performance -- arithmetic, numeric() type, arrays

2005-04-03 Thread Karl O. Pinc
FYI Postgresql 8.0.1 $ uname -a Linux example.example.com 2.4.21-27.0.2.ELsmp #1 SMP Wed Jan 19 01:53:23 GMT 2005 i686 i686 i386 GNU/Linux Incrementing the loop counter by a factor of 10, from 1000 to 1 makes the process take more than 100 times longer. (I only saw this happen when I happen

Re: [GENERAL] Strange plpgsql performance -- arithmetic, numeric()

2005-04-04 Thread Karl O. Pinc
On 04/03/2005 08:04:27 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > Incrementing the loop counter by a factor of 10, from 1000 to 1 > makes the process take more than 100 times longer. (I only saw > this happen when I happened upon using a nume

[GENERAL] Vacuum, statistics, & trigger/procedure query plan caching

2005-04-04 Thread Karl O. Pinc
Hi, IIRC I once figured out that, for triggers at least, query plans are cached with the connection. This means that vacuuming and thus alterations in the statistics do not take effect until a connection is broken and re-established. Mostly. At least for triggers. I think. (In 7.4?) I can't seem

[GENERAL] Rpm packaging of 8.0.2 libraries

2005-05-04 Thread Karl O. Pinc
groupadd -g 26 -o -r postgres >/dev/null 2>&1 || : @@ -673,7 +673,7 @@ %{_bindir}/pg_autovacuum %doc contrib/*/README.* contrib/spi/*.example -%files libs -f libpq.lang +%files libs8 -f libpq.lang %defattr(-,root,root) %{_libdir}/libpq.so.* %{_libdir}/libecpg.so.* @@ -782,6 +782,11 @@

Re: [GENERAL] Anyone doing a 8.0.2-x86_64-RHEL4.rpm?

2005-05-07 Thread Karl O. Pinc
On 05/05/2005 05:46:16 PM, Daniel Browning wrote: [I posted this recently to ports, but I think this is a more proper location] Is anyone working on an 8.0.2 RPM for x86_64 on Red Hat Enterprise Linux 4? There is a i686 version for RHEL4, and a x86_64 version for RHEL3, but no combination of the t

Re: [GENERAL] libpq.so.3 problem, PostgreSQL >= 8.0.2 and RPM

2005-06-17 Thread Karl O. Pinc
On 05/26/2005 06:08:00 PM, Devrim GUNDUZ wrote: Hi, AFAICS from the user requests, many people is not aware about the compatibility RPM we built: http://developer.PostgreSQL.org/~devrim/compat-postgresql-libs-3-2PGDG.i686.rpm is the compatibility RPM that fixes the problem which arose with P

Re: [GENERAL] Making the DB secure

2005-06-17 Thread Karl O. Pinc
On 06/17/2005 07:49:07 AM, Együd Csaba wrote: Hi, we plan to make available our database from the internet (direct tcp/ip based connections). We want to make it as secure as possible. There are a few users who could access the database, but we want to block any other users to access. Disclamer

[GENERAL] ALTER FUNCTION semantics

2005-06-18 Thread Karl O. Pinc
Hi, The semantics of ALTER FUNCTION are not clear to me. I'm too lazy to test the semantics. Will somebody please explain how it works? I see two issues. What it does and when it does it. The documentation says ALTER FUNCTION "changes the definition of a function", which could be read to imp

Re: [GENERAL] Foreign key to a view (UNION of two or more tables),

2005-06-19 Thread Karl O. Pinc
On 06/19/2005 11:16:34 AM, Jose Gonzalez Gomez wrote: On 6/17/05, Bruno Wolff III <[EMAIL PROTECTED]> wrote: > On Fri, Jun 17, 2005 at 14:35:01 +0200, > Jose Gonzalez Gomez <[EMAIL PROTECTED]> wrote: > > > > The problem comes when you have questions that may be not applicable > > (8), or optio

Re: [GENERAL] Making the DB secure

2005-06-20 Thread Karl O. Pinc
On 06/20/2005 12:32:12 PM, Együd Csaba wrote: Hi, thank you very much. These are very good ideas, I think. I forgot one thing to mention. We will have very few clients (max. 20) and all clients will be required to have a fix IP address. Fix IP addresses can be listed in pg_hba.conf to filter inc

Re: [GENERAL] Making the DB secure

2005-06-20 Thread Karl O. Pinc
On 06/20/2005 01:45:48 PM, Együd Csaba wrote: Hi Karl, OK, I see the point. We are going to look around the VPN. So as a conclusion: can we state, that, in addition to all the security features postgres provides, applying a VPN - with SSL and firewal - is enough to provide the necessary security

Re: [GENERAL] Vacuum advice

2005-06-22 Thread Karl O. Pinc
On 06/22/2005 04:39:00 PM, Tom Lane wrote: David Mitchell <[EMAIL PROTECTED]> writes: > However, occasionally we need to import data, and this involves > inserting several million rows into a table, but this just *cripples* > postgres. After the import has been running for a while, simple select

Re: [GENERAL] Help me urgently

2005-06-23 Thread Karl O. Pinc
On 06/23/2005 10:28:49 AM, Richard Huxton wrote: Kapil Malhotra wrote: Hi.. I am running postgres 8.0.3 on red hat 9 and i have installed pgadmin III 1.2 on win 2000 professional client. i want to establish a connection between win client and postgres server.. Make sure your server is actual

[GENERAL] Db and schema names in logged errors

2005-07-11 Thread Karl O. Pinc
Is there any way to get the DB and schema name into error messages, particularly when the errors are logged? I'd like to be able to distinguish errors coming from the test databases from those coming from the live databases. Thanks. Karl <[EMAIL PROTECTED]> Free Software: "You don't pay back,

Re: [GENERAL] A trigger that acts on a column with a given column

2005-07-11 Thread Karl O. Pinc
On 07/07/2005 02:28:23 PM, BigSmoke wrote: In a trigger function, I'm trying to refer to a column given by an argument to the trigger function. I sometimes have a tendency to use the m4 macro processor to write different trigger functions with the correct column name substituted in where appro

Re: [GENERAL] Db and schema names in logged errors

2005-07-12 Thread Karl O. Pinc
On 07/12/2005 09:15:20 AM, Michael Fuhr wrote: On Mon, Jul 11, 2005 at 07:43:48PM +, Karl O. Pinc wrote: > Is there any way to get the DB and schema name into > error messages, particularly when the errors > are logged? To see how logging can be configured, refer to "Error

[GENERAL] pg_dump design problem (bug??)

2006-10-02 Thread Karl O. Pinc
Postgresql 8.1.3 Hi, I'm wondering if there's a problem with pg_dump --create, or if I'm just missing something. It does not seem to restore things like: ALTER DATABASE foo SET "DateStyle" TO European; Shouldn't the database that is re-created be like the database that is being dumped? For ou

[GENERAL] plpgsql FOUND bug when SELECT INTO assigns a NULL value?

2006-10-19 Thread Karl O. Pinc
Hi, The docs say: A SELECT INTO statement sets FOUND true if it returns a row, false if no row is returned. I'm running a plpgsql procedure from a trigger and am doing a "SELECT INTO foo bar ..." where a row matches the selection criteria, but the value of that row's bar column is NULL. The

Re: [GENERAL] plpgsql FOUND bug when SELECT INTO assigns a NULL

2006-10-20 Thread Karl O. Pinc
On 10/19/2006 10:13:46 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > I would expect that because a row exists, even > though the value assigned is NULL, FOUND would > be TRUE. Are my expectations wrong? No, but I think your code is. Please provide

[GENERAL] Views: having a rule call a function vs. using a before trigger

2007-02-20 Thread Karl O. Pinc
, date DATE , start TIME(0) , stop TIME(0)); - The function: CREATE OR REPLACE FUNCTION _interact_insert(this_row interact) RETURNS interact_data LANGUAGE plpgsql AS $$ -- Handle inserts into the

Re: [GENERAL] invalid input syntax for integer: "NULL"

2007-02-20 Thread Karl O. Pinc
On 02/20/2007 03:45:55 PM, Yonatan Ben-Nes wrote: Hi everyone, I'm trying to write a PL/pgSQL function which execute an insert, I encounter a problem when I try to insert NULL value into an integer field. RETURN 'INSERT INTO test (bh) VALUES ('||COALESCE(intornull, 'NULL')||')'; And i

[GENERAL] Supported plpgsql BEFORE ... EACH ROW behavior

2007-02-22 Thread Karl O. Pinc
Hi, I want to write a plpgsql function for use as a BEFORE ... EACH ROW function. I want to modify other tables even when the function returns NULL and therefore the table on which the BEFORE trigger is defined is not updated. Can I count on this behavior being supported in the future? There's

Re: [GENERAL] Supported plpgsql BEFORE ... EACH ROW behavior

2007-02-23 Thread Karl O. Pinc
On 02/23/2007 02:03:25 AM, Richard Huxton wrote: Karl O. Pinc wrote: I want to write a plpgsql function for use as a BEFORE ... EACH ROW function. I want to modify other tables even when the function returns NULL and therefore the table on which the BEFORE trigger is defined is not updated

[GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
Hi, I want to do some additional data validation when data is changed through a view, and I want pretty exception messages, and I want to do some slightly complex processing when determining what data to update where in what order. So, I figured I'd make a table, put some BEFORE EACH ROW trigger

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 06:25:54 PM, Joshua D. Drake wrote: create your table, create your triggers on the table. Use a view on top of the table for viewing (there is no such thing as a select rule (well there is, but it is called a view)). Yes, and you can't put a BEFORE EACH ROW trigger on a view, wh

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 06:25:54 PM, Joshua D. Drake wrote: create your table, create your triggers on the table. Use a view on top of the table for viewing (there is no such thing as a select rule (well there is, but it is called a view)). Maybe you don't understand, I want to modify the underlying ta

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 06:47:56 PM, Joshua D. Drake wrote: Karl O. Pinc wrote: > > On 02/24/2007 06:25:54 PM, Joshua D. Drake wrote: > >> create your table, create your triggers on the table. >> Use a view on top of the table for viewing (there is no such thing as >> a >>

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 06:51:27 PM, Webb Sprague wrote: . I have _additional_ constraints to place on modifications done through views, and trickyness involved in modifying the underlying tables. Write a function foo that returns a set, then a view: "create view as select * from foo()". Incorporate

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 06:55:45 PM, Webb Sprague wrote: I also think that a view is supposed to be just that -- a *view* of underlying data, which in no way modifies the data. I don't know much about the design ideas behind SQL, but I think this view of views (haha) is an underlying assumption. If you

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
(Important stuff last.) On 02/24/2007 07:48:58 PM, Tom Lane wrote: The reason there will never be an insertion trigger event is that we reject any INSERT on a view that isn't rewritten (by an unconditional DO INSTEAD rule) into something else. (Yup. But I tried to make my own view implimentat

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 08:30:21 PM, Karl O. Pinc wrote: How is it that the rules can come up with NEW and OLD for a view and why wouldn't something be able to give triggers the same data. Ah, NEW and OLD are only good in the WHERE part of the rule, which is still in "query land"

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 08:48:04 PM, Karl O. Pinc wrote: Ah, NEW and OLD are only good in the WHERE part of the rule, which is still in "query land" country before execution starts. No. I'm wrong here. Karl <[EMAIL PROTECTED]> Free Software: "You don&#

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-24 Thread Karl O. Pinc
On 02/24/2007 08:55:40 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: NEW and OLD only include the user-visible columns. I'm not sure that that's sufficient. If you assume that the view exposes a primary key for each of its underlying tables, t

Re: [GENERAL] Why can't I put a BEFORE EACH ROW trigger on a view?

2007-02-25 Thread Karl O. Pinc
On 02/24/2007 11:24:40 PM, Jaime Casanova wrote: On 2/24/07, Karl O. Pinc <[EMAIL PROTECTED]> wrote: http://www.postgresql.org/docs/current/static/rules-views.html Actually, i found it very clear: if you create a SELECT rule on a table it becomes a view, this is what postgres does

Re: [GENERAL] General Ledger db design

2007-02-25 Thread Karl O. Pinc
On 02/25/2007 06:21:45 PM, Kenneth Downs wrote: Martin Winsler wrote: This is a real world situation where referential integrity needs to be broken in theory, I believe. Does anybody have any experience or knowledge of building financial accounting databases? Am I wrong about this? Th

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Karl O. Pinc
On 02/26/2007 07:40:17 AM, Kenneth Downs wrote: Karl O. Pinc wrote: On 02/25/2007 06:21:45 PM, Kenneth Downs wrote: Martin Winsler wrote: This is a real world situation where referential integrity needs to be broken in theory, I believe. The problem is that with "double entry accou

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Karl O. Pinc
On 02/26/2007 11:41:18 AM, Kenneth Downs wrote: You can also not allow new rows to be inserted if there is already a batch row, thus the insertion of a batch row "closes" the batch. Not sure what you mean, but you can in fact have any number of open batches, on the assumption that it is a m

[GENERAL] Importing data into views fails

2007-04-02 Thread Karl O. Pinc
Hi, I've created an INSERT rule on a view but when I try to use the COPY command to import data into the view it fails with. cannot copy to view "viewname" I can create a temporary table and COPY into the temporary table and then INSERT into the view by selecting from the temporary table. Bu

[GENERAL] Nairobi time zone fails in 7.4

2004-11-15 Thread Karl O. Pinc
Hi, In 7.3 I was able to do: ALTER DATABASE babase SET "TimeZone" TO 'Nairobi'; a nice Posix TZ value (FYI UTC+3 w. no daylight savings time). In 7.4 this no longer works. I see some UTC+3 time zones in the 7.4 docs, but how am I to know that they correspond to Kenyan time, especially with respect

Re: [GENERAL] Nairobi time zone fails in 7.4

2004-11-15 Thread Karl O. Pinc
On 2004.11.15 10:42 Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > In 7.3 I was able to do: > ALTER DATABASE babase SET "TimeZone" TO 'Nairobi'; > a nice Posix TZ value (FYI UTC+3 w. no daylight savings time). I think the usual s

[GENERAL] Postgres not using shared memory

2004-12-10 Thread Karl O. Pinc
Hi, I can't seem to get postgresql to use shared memory and performance is terrrible. PostgreSQL 7.4.6 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) $ uname -a Linux artsdata 2.4.21-20.0.1.ELsmp #1 SMP Wed Nov 24 20:34:01 EST 2004 i686 i686 i386 GNU

Re: [GENERAL] Postgres not using shared memory

2004-12-16 Thread Karl O. Pinc
On 2004.12.10 15:30 Doug McNaught wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > Hi, > > I can't seem to get postgresql to use shared memory and performance is > terrrible. 1) Linux doesn't track shared pages (which is not the same as shared memory) a

[GENERAL] Binding of "AS" vis "JOIN"

2005-02-04 Thread Karl O. Pinc
Hi, I'm doing some complicated joining and am getting error messages about unknown relations and can't figure out what's up. I'm wondering if "as" aliasing gives an alias to the product of a join, not just the one table that appears immediately in front of the "as". ? Rather than try to describe

Re: [GENERAL] Questions about functionality

2005-02-04 Thread Karl O. Pinc
On 02/04/2005 10:06:49 AM, Ignacio Colmenero wrote: Hello. I have been in this list for a very short period of time so, if my questions have been answered before, please tell me and I will browse again in the archives. 1. Is there anything in Postgre or third-party solutions similar to Oracle's SQL

[GENERAL] Referencing uninitialized variables in plpgsql

2005-02-05 Thread Karl O. Pinc
Hi, I've a plpgsql procedure I'm pretty sure is referencing variables, array elements really, that have not been initialized. Is this a well defined operation? If so, what is the result? (NULL?) If not, shouldn't I be getting some sort of error or warning? I've SET client_min_messages='debug'; and

Re: [GENERAL] security

2005-02-05 Thread Karl O. Pinc
On 02/05/2005 08:08:00 PM, Ron Peterson wrote: I would like to be able to assert that the security of data stored as a value in a PostgreSQL table can be as high as the security of saving that same piece of data to a file on disk. Would that be correct? Well, from a theoretical perspective you're

Re: [GENERAL] Referencing uninitialized variables in plpgsql

2005-02-06 Thread Karl O. Pinc
On 02/05/2005 10:57:45 PM, John DeSoi wrote: Yes, exactly. If you don't assign a value to a declared pspgsql variable, it is NULL. Thanks, just what I needed. If you are concerned about this, then always assign a value when you declare it. This does not really address my concern. See below. Also

[GENERAL] Permissions on implicit SERIAL datatype seqeuences

2005-02-07 Thread Karl O. Pinc
Hi, I see there's been some discussion about cascading GRANTS to implicitly created sequences. Regardless, a heads-up in the documentation could be a nice thing to have, noting that permissions will have to be created (or not) for the implicit seqeuences. I _should_ know better, but just got bit by

[GENERAL] New.* and old.* as function arguments within rules

2005-12-02 Thread Karl O. Pinc
Hi, I'm trying to make sure I understand what I'm doing. Where is new.* and old.* documented, as regards using them as arguments to functions called from rules? If it's not documented then can I rely on this syntax continuing to work? (It's tough searching on these strings. :-) TIA Karl <[

Re: [GENERAL] New.* and old.* as function arguments within rules

2005-12-03 Thread Karl O. Pinc
On 12/03/2005 01:43:38 AM, Andreas Kretschmer wrote: Karl O. Pinc <[EMAIL PROTECTED]> schrieb: > Hi, > > I'm trying to make sure I understand what I'm doing. > > Where is new.* and old.* documented, as regards > using them as arguments to functions called fro

Re: [GENERAL] Regular Expression Question

2005-12-03 Thread Karl O. Pinc
On 12/03/2005 05:48:59 AM, Terry Lee Tucker wrote: RE Gurus: I have a situation where I need to extract a couple pieces of information from a string. The string, if entered perfectly by the user, would look someting like this: DUN: 006235835 SID: KT-3616* I need to extract the 006235835 into

Re: [GENERAL] New.* and old.* as function arguments within rules

2005-12-03 Thread Karl O. Pinc
On 12/03/2005 10:29:43 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > 2nd, nowhere have I found a NEW.* syntax (as written). In general, "foo.*" where foo is a visible table alias is meaningful anywhere that a rowtype value would be accepted. T

[GENERAL] Use of %ROWTYPE in plpgsql function declarations

2005-12-03 Thread Karl O. Pinc
FYI, FWIW. Speaking of documentation, it's none too clear that %ROWTYPE does not seem to work when declaring plpgsql functions. (pg 8.0.3 I looked at the release notes and didn't see anything fixed in newer versions.) So, either the docs are broken, postgres is broken, or I'm not reading thing

Re: [GENERAL] Use of %ROWTYPE in plpgsql function declarations

2005-12-03 Thread Karl O. Pinc
On 12/03/2005 11:31:34 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > Speaking of documentation, it's none too clear that > %ROWTYPE does not seem to work when declaring plpgsql > functions. There is noplace that claims that it does. Perhaps you

[GENERAL] "gmake check" fails with 8.1.1

2005-12-15 Thread Karl O. Pinc
Hi, I don't know what to make of this. I installed the rpms for 8.1.1 on a RH 4 es system and did initdb with LC_TYPE=C and LC_COLLATE=C (and I also tried without changing these locale variables): cd /usr/lib/pgsql/test gmake check gets: rm -rf ./testtablespace mkdir ./testtablespace /bin/sh

Re: [GENERAL] "gmake check" fails with 8.1.1

2005-12-15 Thread Karl O. Pinc
On 12/15/2005 09:45:12 AM, Tom Lane wrote: Devrim GUNDUZ <[EMAIL PROTECTED]> writes: > I reproduced the same... rpath problem? It would be useful to look at the postmaster log to see why it's failing to create the language in the 'make check' case. I don't believe it's just the 'make check'

Re: [GENERAL] "gmake check" fails with 8.1.1

2005-12-15 Thread Karl O. Pinc
On 12/15/2005 09:55:08 AM, Tom Lane wrote: I'm inclined to guess that it's specific to "make check"'s temporary installation. Have you tried "make installcheck" to run against a non-temp installation? 'make installcheck' gets the same errors (and the same regression.diffs file (except for th

Re: [GENERAL] "gmake check" fails with 8.1.1

2005-12-15 Thread Karl O. Pinc
Problem solved. On 12/15/2005 09:55:08 AM, Tom Lane wrote: Please note also that this is not a generic breakage. What you need to be asking is what in your particular environment is causing this failure. The problem is that the rpm substitutes in a Makefile that does not install the language.

[GENERAL] Converting seconds past midnight to a time

2005-12-17 Thread Karl O. Pinc
Hi, What is the best way to convert an integer number of seconds past midnight into a time? I can't seem to figure out a way that does not involve casts to strings, which seems wasteful. On a related note is there some reason why interval + int does not result in the interval plus int number of

Re: [GENERAL] DBlink documentation

2005-12-17 Thread Karl O. Pinc
On 12/17/2005 08:33:02 AM, Russ Brown wrote: Is the documentation not available online somewhere? There is always the CVS web interface: http://developer.postgresql.org/cvsweb.cgi/pgsql/ Karl <[EMAIL PROTECTED]> Free Software: "You don't pay back, you pay forward." -- Rober

Re: [GENERAL] Converting seconds past midnight to a time

2005-12-17 Thread Karl O. Pinc
On 12/17/2005 10:21:39 PM, Michael Glaesemann wrote: On Dec 18, 2005, at 13:25 , Karl O. Pinc wrote: On a related note is there some reason why interval + int does not result in the interval plus int number of seconds? Why should the int necessarily represent seconds and not some other

Re: [GENERAL] Converting seconds past midnight to a time

2005-12-19 Thread Karl O. Pinc
General purpose date functions. -- CREATE OR REPLACE FUNCTION julian(this_date DATE) RETURNS INT LANGUAGE plpgsql IMMUTABLE AS $$ -- Convert a date into its Julian Day. -- -- Copyright (C) 2004 Karl O. Pinc <[EMAIL PROTECTED]> -- Distributed under the GNU General Public Lic

[GENERAL] Confirming the autovacuum daemon is running

2006-02-08 Thread Karl O. Pinc
Hi, What is the proper way to confirm that the autovacuum daemon is running? I just turned autovacuuming on and don't notice another process with ps. Thanks. Karl <[EMAIL PROTECTED]> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein --

Re: [GENERAL] Confirming the autovacuum daemon is running

2006-02-08 Thread Karl O. Pinc
On 02/08/2006 06:06:25 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > What is the proper way to confirm that the autovacuum daemon > is running? The autovac process doesn't run continuously, so you wouldn't necessarily see it in ps. Tha

[GENERAL] Request to have VACUUM ignore cost based limits

2006-02-08 Thread Karl O. Pinc
Hi, Just had a situation where a database was reloaded and needed to be vacuum analyzed before it could be used. I believe the cost-based vacuum delay slowed this down considerably. (I could be wrong, but there was darn little load on the system...) It would have been nice to have an option to

Re: [GENERAL] Request to have VACUUM ignore cost based limits

2006-02-08 Thread Karl O. Pinc
On 02/08/2006 09:46:46 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > It would have been nice to have an option to SQL's VACUUM that would > ignore the cost-based delays so as to bring that database back > to life as rapidly as possible. (Likewis

Re: [GENERAL] Request to have VACUUM ignore cost based limits

2006-02-09 Thread Karl O. Pinc
On 02/09/2006 12:19:39 AM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > But isn't SET server wide? No. Perhaps you need to read http://www.postgresql.org/docs/8.1/static/runtime-config.html#CONFIG-SETTING Yes, I do. Thanks. (Probably a sign it&

[GENERAL] Problems running regression tests

2006-03-24 Thread Karl O. Pinc
FYI, Postgres 8.0.7 OS Centos 4.2 (Final) Rebuilt and installed the rpms. To test, I copied /usr/lib/pgsql/test/regress/ to my home directory. However, gmake check always produces /usr/bin/chcon: can't apply partial context to unlabeled file testtablespace /usr/bin/chcon: can't apply par

Re: [GENERAL] Problems running regression tests

2006-03-25 Thread Karl O. Pinc
On 03/24/2006 10:07:24 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > The Makefile has Does it work better if you change that to [ -x /usr/bin/chcon ] && /usr/bin/chcon -u user_u -r object_r -t postgresql_db_t testtablespace results Nope. The

[GENERAL] pg_restore duplicate key violations

2006-05-08 Thread Karl O. Pinc
Hello, PostgreSQL 8.1.3, Centos 4.2 I'm having trouble with a dump and restore: $ pg_dump --format=t --schema=babase --data-only --user babase_admin babase_test | pg_restore --data-only --disable-triggers --user babase_admin --dbname=babase pg_restore: ERROR: duplicate key violates unique

Re: [GENERAL] pg_restore duplicate key violations

2006-05-09 Thread Karl O. Pinc
On 05/08/2006 06:42:18 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > I'm having trouble with a dump and restore: > $ pg_dump --format=t --schema=babase --data-only --user babase_admin > babase_test | pg_restore --data-only --disable-triggers

Re: [GENERAL] pg_restore duplicate key violations

2006-05-09 Thread Karl O. Pinc
On 05/09/2006 10:24:28 AM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > On 05/08/2006 06:42:18 PM, Tom Lane wrote: >> Um ... it looks to me like you're trying to restore into an existing >> table that already has the same data loaded ... &g

Re: [GENERAL] pg_restore duplicate key violations

2006-05-09 Thread Karl O. Pinc
On 05/08/2006 06:42:18 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > I'm having trouble with a dump and restore: Um ... it looks to me like you're trying to restore into an existing table that already has the same data loaded ... Thanks ever

[GENERAL] pg_dump design problem (bug??)

2006-05-09 Thread Karl O. Pinc
Postgresql 8.1.3 Hi, I'm wondering if there's a problem with pg_dump --create, or if I'm just missing something. It does not seem to restore things like: ALTER DATABASE foo SET "DateStyle" TO European; Shouldn't the database that is re-created be like the database that is being dumped? For ou

Re: [GENERAL] pg_dump design problem (bug??)

2006-05-09 Thread Karl O. Pinc
On 05/09/2006 03:47:20 PM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > I'm wondering if there's a problem with pg_dump --create, > or if I'm just missing something. > It does not seem to restore things like: > ALTER DATABASE foo S

Re: [GENERAL] pg_dump design problem (bug??)

2006-06-27 Thread Karl O. Pinc
On 06/27/2006 09:29:36 AM, Nikolay Samokhvalov wrote: So, what about it? I periodically encounter with the same problem. People (e.g. me :-) but not only) expect that when they use pg_dump to backup some database (either schema only or both schema and data), all database properties will be dum

[GENERAL] Long term database archival

2006-07-06 Thread Karl O. Pinc
Hi, What is the best pg_dump format for long-term database archival? That is, what format is most likely to be able to be restored into a future PostgreSQL cluster. Mostly, we're interested in dumps done with --data-only, and have preferred the default (-F c) format. But this form is somewhat

Re: [GENERAL] Long term database archival

2006-07-06 Thread Karl O. Pinc
On 07/06/2006 06:14:39 PM, Florian G. Pflug wrote: Karl O. Pinc wrote: Hi, What is the best pg_dump format for long-term database archival? That is, what format is most likely to be able to be restored into a future PostgreSQL cluster. Anyway, 20 years is a _long_, _long_ time. Yes, but

Re: [GENERAL] Long term database archival

2006-07-12 Thread Karl O. Pinc
On 07/12/2006 09:25:45 AM, Jan Wieck wrote: On 7/6/2006 8:03 PM, Karl O. Pinc wrote: On 07/06/2006 06:14:39 PM, Florian G. Pflug wrote: Karl O. Pinc wrote: Hi, What is the best pg_dump format for long-term database archival? That is, what format is most likely to be able to be restored

[GENERAL] Where did the compat-postgresql-libs rpm get to?

2006-08-01 Thread Karl O. Pinc
Hi, Whatever happened to the rpm packaging of the 7.x libpq? (Which enabled programs linked against the old libraries to be used with a 8.x. postgresql.) Last time I went looking for it I couldn't find it. Thanks. Karl <[EMAIL PROTECTED]> Free Software: "You don't pay back, you pay forward."

[GENERAL] Triggers per transaction, workaround? prospects?

2004-02-28 Thread Karl O. Pinc
Hi, I don't suppose that the todo item: Referential Integrity o Add deferred trigger queue file (Jan) Means that there will be a statement like: CREATE TRIGGER ... FOR EACH TRANSACTION ? I frequently encounter situations where the database is only 'good' when all the the statements in the tr

Re: [GENERAL] Moving from MySQL to PGSQL....some questions

2004-02-28 Thread Karl O. Pinc
"Karam Chand" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > 5.) In MySQL, there are many command like show tables, > show databases etc. to get object details. I cant see > anything similar in PGSQL. After searching the net i > find that i have to execute certain queries to fetch

[GENERAL] Max/min of 2 values function, plpgsql efficency?

2004-03-02 Thread Karl O. Pinc
I'd like to write: SELECT larger(colA, colB) FROM foo and am wondering the best way to go about it. (Really, I'd like the larger() function to take an arbitrary number of arguments but I don't see how to do that.) Are there significant performance penalities if I were to use a a homemade plpgpgq

[GENERAL] REFERENCES error message complaint, suggestion

2004-03-03 Thread Karl O. Pinc
FYI, It'd be nice if the error message from a REFERENCES constraint mentioned the column name into which the bad data was attempted to be inserted. In PostgreSQL 7.3: sandbox=> insert into foo (id, b) values (3, 2); ERROR: b_is_fkey referential integrity violation - key referenced from foo not

Re: [GENERAL] REFERENCES error message complaint, suggestion

2004-03-04 Thread Karl O. Pinc
On 2004.03.04 17:19 Greg Stark wrote: Greg Stark <[EMAIL PROTECTED]> writes: > It's great to know which constraint was violated but that doesn't really help > you figure out *why* it was violated. On further thought it would never be feasible to do what the other poster is really looking for. At l

Re: [GENERAL] 7.4.1 upgrade issues

2004-03-09 Thread Karl O. Pinc
This reminds me of the scheduler optimizations that have been flying around the Linux kernel deveopment over the last year or so. There are cases apparently where this kind of behavior can come up. IIRC it's fixed in later kernels but don't take my word for it, I'm just writing to give a heads-up

Re: [GENERAL] Plpgsql problem passing ROWTYPE to function

2004-04-30 Thread Karl O. Pinc
On 2004.04.29 22:21 Tom Lane wrote: > "Parameters to a function can be composite types (complete table > rows). In that case, the corresponding identifier $n will be a row > variable, and fields can be selected from it, for example $1.user_id." That says that a parameter passed *into* a plpgsql f

Re: [GENERAL] Data in table changed?

2004-06-09 Thread Karl O. Pinc
On 2004.03.02 08:04 Thomas Holmgren wrote: I need an efficient way of determining if data in a table has been changed (either updated, deleted or inserted). Can this be achieved without scanning the tables using expensive SQL? (my tables are _big_!) Is there some way to get a "time for last update

[GENERAL] Obtaining the Julian Day from a date

2004-09-09 Thread Karl O. Pinc
Hi, What's the best way to obtain the Julian day from a postgresql date? PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) I'm doing some date arithmetic with 1 day intervals and want to, for example, round to the even Ju

  1   2   >