Re: [GENERAL] Constraint Question

2006-03-17 Thread Bruno Wolff III
On Thu, Mar 16, 2006 at 18:11:33 +0100, Kai Hessing <[EMAIL PROTECTED]> wrote: > > The 'status'-row can contain either 1 or -1 and -4. And now I would like > to implement the action that if the the status field in the master table > for a special sid is changed, all status-fields in phon for ent

Re: [GENERAL] Replication & web apps

2006-03-17 Thread Leonardo Francalanci
We use continuent at work (albeit for mysql...) on a three node cluster. That's a good project, the only thing I don't like is that one is forced to use Java which is not what I'd like to do (I'd prefer Ruby). Thank you everybody for your answers. Leonardo ---(end

[GENERAL] after insert trigger hangs

2006-03-17 Thread pradeep singh
hello, i am using linux 8.0 along with postgres sql 8.0. here is the schema of the db. create table user_list ( id serial primary key, namecharacter varying (100) not null, login_name character varying (100) not null, passwordcharacter varying

[GENERAL] pgsql variables from records

2006-03-17 Thread SunWuKung
I have a table in which I am storing parameters that I would like to use as variables in a pgsql procedure. Currently I find no other way to refer to these than to assign each record to a variable by a separate query like this: Declare max_option integer; Select Into max_option parameter_value

Re: Fw: [GENERAL] ecpg error --> DbPg_cre_sect_buf.pgc:1334: ERROR: syntax error at or near "RELEASE"

2006-03-17 Thread Michael Meskes
[Catching up on my old email, well at least sort of. Sorry for the delay.] On Wed, Feb 22, 2006 at 10:22:39AM -0500, [EMAIL PROTECTED] wrote: > Will this still result in the closed DB connection that the "ROLLBACK > RELEASE" used to give me? ECPG just sends the queries to the backend the way you

[GENERAL] Query

2006-03-17 Thread vinod kumar bapure
       Your message to pgsql-bugs has been delayed, and requires the approval of the moderators, for the following reason(s): The author ("Vinod Bapure" <[EMAIL PROTECTED]>) is not a member of any of the restrict_post groups. If you do not wish the message to be posted, or have other concerns,

[GENERAL] Transferring databases to another Server

2006-03-17 Thread Harry Knitter
Hello, after a crash of my 64-bit server I have set up a new server (32 bit). The harddsisk of the former server is now in my new server and I have access to the partion where the data were stored. I have tried the following: I copied the contents of /var/lib/pgsql from the old installation into t

[GENERAL] can't create user collumn

2006-03-17 Thread loki
Hi, i'm just starting with postgres DB, but this looks very strange to me: If i try to create table with collumn user, it fails with error: create exec error:ERROR: syntax error at or near "user" at character 368 query: CREATE TABLE Log ( log_datedateNOT NULL, log_time

[GENERAL] each line counter

2006-03-17 Thread Zvonimir Radek
Hi I would like to add counter in front of each row with select command. Does anyone have some idea? Thnx ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining colum

Re: [GENERAL] Constraint Question

2006-03-17 Thread Kai Hessing
Bruno Wolff III wrote: > On Thu, Mar 16, 2006 at 18:11:33 +0100, > Kai Hessing <[EMAIL PROTECTED]> wrote: >> >> The 'status'-row can contain either 1 or -1 and -4. And now I would like >> to implement the action that if the the status field in the master table >> for a special sid is changed, al

[GENERAL] Encountering NULLS in plpgsql

2006-03-17 Thread Randy Yates
I wrote a simple pl to compute running sums, but when it encountered a null on a float4 value it caused pgadminIII to crash (exited abruptly). Is this intended behavior? -- % Randy Yates % "I met someone who looks alot like you, %% Fuquay-Varina, NC% she d

[GENERAL] Table Rows Not Properly Added

2006-03-17 Thread Randy Yates
I have a no-OIDs database with a table that uses a serial primary key. I am using the "View data" option on the table within pgadminIII to enter new rows into the table. When I type enter into the last field of the last row, the "*" row counter increments to the next row. However, nothing is entere

Re: [GENERAL] Table Rows Not Properly Added

2006-03-17 Thread Randy Yates
PostgreSQL 8.0.3 on i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC) 4.0.0 20050505 (Red Hat 4.0.0-4) -- % Randy Yates % "My Shangri-la has gone away, fading like %% Fuquay-Varina, NC% the Beatles on 'Hey Jude'" %%% 919-577-9882%

Re: [GENERAL] can't create user collumn

2006-03-17 Thread chris smith
On 3/17/06, loki <[EMAIL PROTECTED]> wrote: > Hi, > i'm just starting with postgres DB, but this looks very strange to me: > > If i try to create table with collumn user, it fails with error: > create exec error:ERROR: syntax error at or near "user" at character 368 > > query: > CREATE TABLE Log (

[GENERAL] Grant Priviliges on column

2006-03-17 Thread Sean Hamilton
Does Postgres support granting priviliges at the column level? ex. grant update on tableA (id, description) to user ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMA

Re: [GENERAL] Transferring databases to another Server

2006-03-17 Thread Richard Huxton
Harry Knitter wrote: Hello, after a crash of my 64-bit server I have set up a new server (32 bit). The harddsisk of the former server is now in my new server and I have access to the partion where the data were stored. I have tried the following: I copied the contents of /var/lib/pgsql from the

Re: [GENERAL] About index for temporay table in a plpgsql function

2006-03-17 Thread Emi Lu
Hello, The temporary table will be dropped automatically at the end of the function, right? A temp table will be dropped at the end of the connection. You can reuse it by adding ON COMMIT DELETE ROWS and then check if it exists in your function with this other function: http://www.milwauke

[GENERAL] efficiency of group by 1 order by 1

2006-03-17 Thread TJ O'Donnell
>> Is there a way to eliminate the ugly repeated use of >> date_trunc('day',endtime)? >>In this particular case you could say >> >>... GROUP BY 1 ORDER BY 1; I use a similar SQL, e.g.: select func(x)group by func(x) order by func(x) but my func is rather expensive. Is func(x) eval

Re: [GENERAL] Slow trigger on identical DB but different machine

2006-03-17 Thread Tom Lane
Etienne Labuschagne <[EMAIL PROTECTED]> writes: > The strange thing is that both databases are EXACTLY the same with > EXACTLY the same SQL query executed (I restore both DBs from the same > backup file to ensure that everything is the same - data and objects). Have you vacuumed and analyzed in bo

Re: [GENERAL] after insert trigger hangs

2006-03-17 Thread Tom Lane
pradeep singh <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION recalc_add_bitset() > RETURNS trigger AS $$ > use DBI; > my $dbname = 'database_name'; > my $dbh = DBI->connect("dbi:Pg:dbname='$dbname'", > "postgres_user_id", "password", {AutoCommit => 0, > RaiseError=>1}); Tha

Re: [GENERAL] Encountering NULLS in plpgsql

2006-03-17 Thread Richard Huxton
Randy Yates wrote: I wrote a simple pl to compute running sums, but when it encountered a null on a float4 value it caused pgadminIII to crash (exited abruptly). Is this intended behavior? No, but we'll need more information to figure out what is going on. What language did you use for the pro

Re: [GENERAL] pgsql variables from records

2006-03-17 Thread Richard Huxton
SunWuKung wrote: Select Into max_option parameter_value From parameters Where methodid= 999 And parameter_name='max_option' and so on for each parameter. Is there a way to get all these parameters into one variable in pgsql - eg. Select Into paramarray(param_name, param_value) parameter_name,

Re: [GENERAL] each line counter

2006-03-17 Thread Richard Huxton
Zvonimir Radek wrote: Hi I would like to add counter in front of each row with select command. You can sort-of do this by creating a sequence and then dropping it after the query, but basically this is the sort of thing you do in the client application usually. -- Richard Huxton Archon

Re: [GENERAL] Grant Priviliges on column

2006-03-17 Thread Richard Huxton
Sean Hamilton wrote: Does Postgres support granting priviliges at the column level? ex. grant update on tableA (id, description) to user No, but you can do something similar with views + rules and granting permissions on that. -- Richard Huxton Archonet Ltd ---(

Re: [GENERAL] Grant Priviliges on column

2006-03-17 Thread Richard Huxton
Sean Hamilton wrote: Does Postgres support granting priviliges at the column level? ex. grant update on tableA (id, description) to user ... Or, perhaps with a before-update trigger. -- Richard Huxton Archonet Ltd ---(end of broadcast)--- T

Re: [GENERAL] Encountering NULLS in plpgsql

2006-03-17 Thread Randy Yates
dev@archonet.com (Richard Huxton) writes: > Randy Yates wrote: >> I wrote a simple pl to compute running sums, but when it encountered a >> null on a float4 value it caused pgadminIII to crash (exited >> abruptly). Is this intended behavior? > > No, but we'll need more information to figure out wh

Re: [GENERAL] \copy combine with SELECT

2006-03-17 Thread Martijn van Oosterhout
On Fri, Mar 17, 2006 at 10:45:16AM +1100, Chris wrote: > Doesn't look like \copy lets you specify which fields to include though. Ofcourse it does, you just need to use parenthesis. From the manpage: \copy table [ ( column_list ) ] { from | to } filename | stdin | stdout [ with ] [ oids ] [ delim

Re: [GENERAL] picking the correct locale when doing initdb

2006-03-17 Thread Martijn van Oosterhout
On Thu, Mar 16, 2006 at 09:21:56PM -0500, Greg Stark wrote: > In any case having actually implemented multilingual sites I can't imagine one > locale per table being useful at all. You always end up wanting per column, > even per array element locales. Exactly, in the SQL standard it's referred to

Re: [GENERAL] each line counter

2006-03-17 Thread Scott Marlowe
On Fri, 2006-03-17 at 09:30, Richard Huxton wrote: > Zvonimir Radek wrote: > > Hi > > I would like to add counter in front of each row with select > > command. > > You can sort-of do this by creating a sequence and then dropping it > after the query, but basically this is the sort of thing you do

Re: [GENERAL] pgsql variables from records

2006-03-17 Thread SunWuKung
In article <[EMAIL PROTECTED]>, dev@archonet.com says... > SunWuKung wrote: > > Select Into max_option parameter_value From parameters Where methodid= > > 999 And parameter_name='max_option' > > > > and so on for each parameter. > > > > Is there a way to get all these parameters into one variable

Re: [GENERAL] can't create user collumn

2006-03-17 Thread Stephan Szabo
On Fri, 17 Mar 2006, loki wrote: > Hi, > i'm just starting with postgres DB, but this looks very strange to me: > > If i try to create table with collumn user, it fails with error: > create exec error:ERROR: syntax error at or near "user" at character 368 USER is a reserved word in SQL and as s

Re: [GENERAL] pgsql variables from records

2006-03-17 Thread Kenneth Downs
SunWuKung wrote: In article <[EMAIL PROTECTED]>, dev@archonet.com says... SunWuKung wrote: Select Into max_option parameter_value From parameters Where methodid= 999 And parameter_name='max_option' and so on for each parameter. What you are trying t

Re: [GENERAL] PostgreSQL scalability concerns

2006-03-17 Thread Guy Fraser
On Thu, 2006-16-03 at 13:51 -0500, Robert Treat wrote: > On Wednesday 15 March 2006 18:14, Alen Garia - IT wrote: > > Hi, > > > > We are currently planning the deployment of our next generation > > enterprise database and we are wondering whether or not PostgreSQL could do > > the heavy lifting t

Re: [GENERAL] Constraint Question

2006-03-17 Thread Bruno Wolff III
On Fri, Mar 17, 2006 at 10:33:18 +0100, Kai Hessing <[EMAIL PROTECTED]> wrote: > > OK, it is really a little bit odd. I try to explain what should be done. > I have 1:n connection between stud and phon (One student does have > different phonenumbers, fax, eMails, etc...). A positive status means

Re: [GENERAL] PostgreSQL scalability concerns

2006-03-17 Thread Daniel Blaisdell
If you'd like to get some more detailed information, there is a Postgres-HA webinar on March 23rd that looks very interesting and should answer your questions. Direct Link: http://www.postgresql.org/about/event.347 -Daniel On 3/17/06, Guy Fraser <[EMAIL PROTECTED]> wrote: On Thu, 2006-16-03 at 13

Re: [GENERAL] will slony work for this ?

2006-03-17 Thread Guy Fraser
On Thu, 2006-16-03 at 19:05 -0500, Robert Treat wrote: > On Thursday 16 March 2006 14:46, Joshua D. Drake wrote: > > Tony Caduto wrote: > > > I have two Postgresql 8.1 servers each one is in a DMZ and each one > > > has a apache server running on it. > > > What I want to do is have real time 2 way

Re: [GENERAL] pgsql variables from records

2006-03-17 Thread SunWuKung
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > SunWuKung wrote: > > >In article <[EMAIL PROTECTED]>, dev@archonet.com says... > > > > > >>SunWuKung wrote: > >> > >> > >>>Select Into max_option parameter_value From parameters Where methodid= > >>>999 And parameter_name='max_optio

Re: [GENERAL] efficiency of group by 1 order by 1

2006-03-17 Thread Merlin Moncure
> I use a similar SQL, e.g.: > select func(x)group by func(x) order by func(x) > but my func is rather expensive. Is func(x) evaluated three times > in the above statement? Would it be evaluated only once if I used > select func(x)group by 1 order by 1 try: select q.v from (select f

[GENERAL] pgsql variables from records

2006-03-17 Thread karly
SunWuKung <[EMAIL PROTECTED]> wrote: > > I have a table in which I am storing parameters that I would like to use > as variables in a pgsql procedure. > > Currently I find no other way to refer to these than to assign each > record to a variable by a separate query like this: I'm not sure if y

[GENERAL] Strange startup error

2006-03-17 Thread Andrew Stewart
I have had postgres working perfectly up until recently. Now suddenly I get an error when trying to run postgres: % psql psql: FATAL: No pg_hba.conf entry for host localhost, user postgres, database postgres % postmaster & LOG: could not bind Unix socket: Address already in use HINT: Is a

Re: [GENERAL] efficiency of group by 1 order by 1

2006-03-17 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > select f(x) from t where id = 1 order by n; > can cause f to execute for the entire table even if id is unique. Really? I'd consider it a bug if so. Compare select 1/x from t where x > 0 If the presence of zeroes in t can make this throw

[GENERAL] Server "deadlock"?

2006-03-17 Thread William Leite Araújo
I have 2 tables, A and B. Onde update on A fires a trigger "Ta" that insert by "dblink_exec" on B. B has an insert trigger "Tb" that print a message before line "RETURN NEW;"  command of "Tb", but "Ta" call to "dblink_exec" doesn't return "never"... Any idea?tank's a lot-- William Leite A

Re: [GENERAL] Strange startup error

2006-03-17 Thread Peter Wiersig
On Fri, Mar 17, 2006 at 03:05:17PM -0500, Andrew Stewart wrote: > I have had postgres working perfectly up until recently. Now suddenly I > get an error when trying to run postgres: > > % psql > psql: FATAL: No pg_hba.conf entry for host localhost, user postgres, > database postgres > > % pos

Re: [GENERAL] Strange startup error

2006-03-17 Thread William Leite Araújo
    pg_ctl status [-D /postgres/data/dir]On 3/17/06, Andrew Stewart <[EMAIL PROTECTED]> wrote: I have had postgres working perfectly up until recently.  Now suddenly Iget an error when trying to run postgres:% psqlpsql: FATAL:  No pg_hba.conf entry for host localhost, user postgres,database postgre

Re: [GENERAL] pgsql variables from records

2006-03-17 Thread SunWuKung
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > SunWuKung <[EMAIL PROTECTED]> wrote: > > > > I have a table in which I am storing parameters that I would like to use > > as variables in a pgsql procedure. > > > > Currently I find no other way to refer to these than to assign each >

Re: [GENERAL] efficiency of group by 1 order by 1

2006-03-17 Thread Merlin Moncure
On 3/17/06, Tom Lane <[EMAIL PROTECTED]> wrote: > "Merlin Moncure" <[EMAIL PROTECTED]> writes: > > select f(x) from t where id = 1 order by n; > > can cause f to execute for the entire table even if id is unique. > > Really? I'd consider it a bug if so. Compare > > select 1/x from t where

[GENERAL] Inherit for parallel log tables

2006-03-17 Thread josue
Hello list, It could be anything wrong with using inherits for creating parallel log tables that will be updated via trigger functions, what I'm trying to avoid is modify the log table if the base table structure changes (adding/dropping columns) Thanks in advance, -- Sinceramente, Josué M

Re: [GENERAL] Grant Priviliges on column

2006-03-17 Thread Marc Munro
No, but Veil allows you do it: http://veil.projects.postgresql.org/ Be warned, implementing column or row-level privileges is not trivial. If you are sure you need to do it and want to try Veil, I'll give you what help I can. __ Marc On Fri, 2006-03-17 at 11:50 -0400, [EMAIL PROTECTED] wrote: >

Re: [GENERAL] question about postgresql time intervals

2006-03-17 Thread Michael Glaesemann
I've been having some email problems, so my apologies if this is a duplicate. On Mar 16, 2006, at 22:49 , Linda wrote: Thanks for your reply. I guess you missed the original email. I have an application that is retrieving "uptime" (an integer number of seconds since reboot) and recasti

Re: [GENERAL] Relation 'pg_largeobject' does not exist

2006-03-17 Thread Tom Lane
"Brandon Keepers" <[EMAIL PROTECTED]> writes: > If it makes a difference, when I un-tar the dump file from each failed > dump, it always has 2937 files in it. That's pretty consistent with the idea that you're running out of locktable space --- you'd expect that to fail at a certain number of dump

[GENERAL] Transactions

2006-03-17 Thread Kevin Brown
I've been creating a databased application with PostgreSQL for a while now and have loved it, though we just recently stumbled on an interesting bug. I have a particular dialog which can do all kinds of incredibly complicated things to the database. Of course I didn't want to have to write the

Re: [GENERAL] Transactions

2006-03-17 Thread Tom Lane
Kevin Brown <[EMAIL PROTECTED]> writes: > So when the dialog opens, it executes a BEGIN, and then based on whether they > clicked ok or cancel on the dialog, it'd COMMIT or ROLLBACK. This worked > fine for me in testing, but now that I have two people using this app > simulatneously, if they bot

Re: [GENERAL] Transactions

2006-03-17 Thread Kevin Brown
On Saturday 18 March 2006 00:19, Tom Lane wrote: > Kevin Brown <[EMAIL PROTECTED]> writes: > > So when the dialog opens, it executes a BEGIN, and then based on whether > > they clicked ok or cancel on the dialog, it'd COMMIT or ROLLBACK. This > > worked fine for me in testing, but now that I have

Re: [GENERAL] Transactions

2006-03-17 Thread Tom Lane
Kevin Brown <[EMAIL PROTECTED]> writes: > When the "deadlock" occurs: > [EMAIL PROTECTED]:~> ps -elF | grep postgres > 1 S postgres 6020 17767 0 75 0 - 10585 - 15136 0 19:57 ? > 00:00:29 postgres: dli dli 127.0.0.1(39869) idle in transaction > 1 S postgres 6195 17767 0 76 0 - 10323 semtim