|
|
Up |
|
|
  |
Author: Erik CederstrandErik Cederstrand
Date: Feb 29, 2008 07:25
Hi list
I want to store sets of configuration options in an m:n table. Each
option is defined by a parameter/value pair, and each set of options has
a unique ID (the data describes non-default hardware configuration of a
group of computers).
Now, given an arbitrary set of options, how do I check if that exact
combination already exists, and either return the ID if it exists, or
insert the set and return the new ID?
The relation is defined as:
CREATE TABLE mach_conf (
id int4 NOT NULL,
param varchar(64) NOT NULL,
value varchar(256) NOT NULL,
CONSTRAINT mach_conf_id PRIMARY KEY (id, param, value)
)
Example table:
|
| Show full article (1.15Kb) |
|
| |
1 Comment |
|
  |
Author: messiasmessias
Date: Feb 28, 2008 23:06
--- Sean Davis mail.nih.gov> wrote (2008.02.28 22:56:08):
---
> 2008/2/28 messias :
>> Hello
>>
>>
>>
>> I am new in SQL programing and I have a problem. I would like
to
>>
>> monitor the new records which is inserted into an SQL table.
>>
>> I found some solution which mentioned a queue (log) table which
can
>>
>> be filled by a trigger. The client would read from that queue
table,
>>
>> and delete the readed data.
|
| Show full article (1.76Kb) |
|
| |
1 Comment |
|
  |
Author: s anwars anwar
Date: Feb 28, 2008 11:53
I have written a PostgreSQL 8.3beta2 server side function named
array_times_scalar (source included below). It works, but I haven't found
sufficient examples to be certain that I am not leaking memory. I was
wondering if someone can either point me to examples or take a look at the
code below.
I am, however, getting incorrect values if I select a particular array index
out of the result of this function. That is, "select
(array_times_scalar('{344,52,25}'::smallint[],0.001::double precision))[1];"
is not the same as the first element of "select
array_times_scalar('{344,52,25}'::smallint[],0.001::double precision);". I
was hoping if someone could shed a light on why that may be.
As a side-note: I've written similar function in plpgsql, which produces
correct results when I extract any element of the returned array. However, I
need the speed of a C-function since this function may be run on millions of
records at a time.
Thanks.
|
| Show full article (11.59Kb) |
|
1 Comment |
|
  |
Author: messiasmessias
Date: Feb 28, 2008 11:06
Hello
I am new in SQL programing and I have a problem. I would like to
monitor the new records which is inserted into an SQL table.
I found some solution which mentioned a queue (log) table which can
be filled by a trigger. The client would read from that queue table,
and delete the readed data.
I think this solution can work with only one client.
But I would have more than one client at the same time, and I do not
know how I can delete the data from the queue table.
I can make queue table for every client, but I think this is not a
nice solution.
I am affraid of lost client....
I am intrested in every solution which can solve my problem.
Any help would is appreciated.
Thanks Ferenc Banhidi
|
| |
|
3 Comments |
|
  |
Author: Ennio-SrEnnio-Sr
Date: Feb 28, 2008 08:44
Hi all!
[Running Debian/Lenny powerpc on an iBook.]
After upgrading from postgresql-8.1 to pg_8.3 I lost the capacity to
connect to my databases. I have re-created them using old dump.out files.
Besides that I just found out that 'pidof' doen't seem to work for the
ordinary user, as far as postgresql is concerned, whereas it works
regularly for other processes:
user$ pidof /usr/sbin/apache
19095 19094 19093 19092 19091 19088
user$ pidof /usr/lib/postgresql/8.3/bin/postmaster
[nihil]
Is this a normal behaviour for the new pg_8.3?
Thanks for your attention.
Regards,
Ennio.
|
| Show full article (1.06Kb) |
|
3 Comments |
|
  |
Author: Szentpali JanosSzentpali Janos
Date: Feb 28, 2008 05:28
Szentpali Janos Ãrta:
> Hi!
>
> Is there a way to find out the priviledges that users have on a
> database object (table | view | sequence)? I am interested in doing it
> via queries and not the psql's \z mytable command.
> Thanks!
>
Sorry to bother you :D I just found the |has_*_privilege functions.|
--
Szentpáli János
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
|
| |
|
no comments
|
|
  |
Author: Obe, ReginaObe, Regina
Date: Feb 28, 2008 05:25
The information_schema.table_privileges view is what I usually use.
Hope that helps,
Regina
-----Original Message-----
From: pgsql-novice-owner@ postgresql.org [mailto:pgsql-novice-owner@ postgresql.org] On Behalf Of Szentpali Janos
Sent: Thursday, February 28, 2008 7:41 AM
To: pgsql-novice@ postgresql.org
Subject: [NOVICE] Priviledges
Hi!
Is there a way to find out the priviledges that users have on a database
object (table | view | sequence)? I am interested in doing it via
queries and not the psql's \z mytable command.
Thanks!
--
Szentpáli János
|
| Show full article (1.19Kb) |
|
no comments
|
|
  |
Author: Szentpali JanosSzentpali Janos
Date: Feb 28, 2008 04:40
Hi!
Is there a way to find out the priviledges that users have on a database
object (table | view | sequence)? I am interested in doing it via
queries and not the psql's \z mytable command.
Thanks!
--
Szentpáli János
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
|
| |
|
no comments
|
|
  |
Author: Mag GamMag Gam
Date: Feb 27, 2008 12:22
Just out of curiously, why would you ever want to do that? (I am not saying
your method is wrong, but SQL should be ample, no?)
On Mon, Feb 18, 2008 at 9:15 AM, John Gunther bucksvsbytes.com>
wrote:
> Thanks, Andreas. That was easy. I thought I new all the value expression
> types, but following your clue, I've learned the last two, ARRAY() and
> ROW(), from Section 4.2.
>
> John
>
>
> A. Kretschmer...
|
| Show full article (2.95Kb) |
|
no comments
|
|
  |
|
|
  |
Author: robertskirobertski
Date: Feb 27, 2008 11:33
From time to time I found on different forums questions "how to recover deleted rows".
If i'm right deleted rows are only mark as deleted but still exist until vacuum (am I right?). So is it possible to restore it, maybe some change of postgres source code and compilation would be needed, but is it possible? I was searching the source code but there are so many files, i have no idea where to look. Could anybody say something?
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@ postgresql.org so that your
message can get through to the mailing list cleanly
|
| |
|
no comments
|
|
|
|
|
|
|