Hate to reply to my own posts, but I thought the solution I've come
across may help others with problems implementing savepoints and
transactions in functions.
This function implements rollbacks whilst still returning a valid row
instead of an exception. A temporary variable is used to get around
Hello,
We have recently migrated to Postgres 8 (not sure of exactly
which build). We have noticed that a few functions that were working previously
are no longer behaving as expected. One function in particular is giving
me a strange result.
The function giving us the problem is much
Hi, list!
You have most probably met the same problem:
I have a master table, describing the objecs I'm interested in - let's
say employees. I have a details table, defining all possible values of
one of the properties of the objects - let's say languages spoken. And
of course I have a table desr
After reading up on Postgres documentation, it seems that transactions
and savepoints are not available to functions, and savepoints are
implemented via BEGIN.. EXCEPTION.. END blocks.
I have a function returning an int4 with the following proposed
structure:
-
This is valid ddl to accomplish what you wish.
create table peoplegroups {
peopleid int not null,
groupid int not null,
primary key (peopleid, groupid),
foreign key (peopleid) references people,
foreign key (groupid) references group
}
Check the docs for other options etc.
From: "Announce" <[
I have the following related tables:
PEOPLE
--
peopleid pkey,
name,
etc
GROUPS
-
groupid pkey,
description,
etc
PEOPLEGROUPS
---
peopleid pkey/fkey,
groupid pkey/fkey
What is the CORRECT way (in Postgres) to define the PEOPLEGROUPS table so
that it has
Andrew,
> I'm in the final stages of porting a large body of ESQL software from
> Informix to PostgreSQL (V8). The last few Informix-based functions
> involve Informix descriptor areas to insert rows into a table. I've
> sorted out the logic for using PostgreSQL descriptor areas for select
> state
I don't understand how this is different:
SELECT person FROM principals
WHERE event IN (SELECT event FROM principals WHERE person = $p AND
tag_type = " .MARR. ")
AND person != $p
ORDER BY sort_date
Or without subselects:
SELECT p1.person
FROM principals p1
JOIN principals p2 USING(event)
WHERE p
On 9/23/05, Kenneth Hutchinson <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm sorry if this has been sent to the community multiple times. I am
> not able to determine whether my posts have gotten through. If you have
> rec'd this multiple times, please let me know.
>
> We have recently migrated to
"Kenneth Hutchinson" <[EMAIL PROTECTED]> writes:
> UPDATE t_summary
> SETavailability = 7
> WHERE oid = 28245084
> When this query is executed (within a function or without) the database
> will simply hang.
Is it really hung, or just taking an awfully long time? If the backend
is consum
> Basically, what I've got is the first person and the tag_type. I can do
> it with a function from PHP:
>
> function get_spouses($p) {
> $handle = pg_query("select person from principals
>where event in (select event from principals
>where person
Hello,
I'm sorry if this has been sent to the community multiple times. I am
not able to determine whether my posts have gotten through. If you have
rec'd this multiple times, please let me know.
We have recently migrated to Postgres 8 (not sure of exactly which
build). We have noticed that a
Axel Rau wrote:
Thank you for responding, Daryl,
Am 22.09.2005 um 16:45 schrieb Daryl Richter:
Axel Rau wrote:
Hi SQLers,
I have a fk from address to network and try to update the foreign key
column to point at the network, "it belongs to":
CREATE TABLE network (
id cidr PRIMARY
On Thursday 22 September 2005 20:03, Dmitri Bichko wrote:
> SELECT * FROM principals WHERE event = 15821 AND person != 2?
Sure, that's a concise answer to what I actually wrote, but it wasn't
exactly what I intended :)
Basically, what I've got is the first person and the tag_type. I can do
it
SELECT * FROM principals WHERE event = 15821 AND person != 2?
Dmitri
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Leif B.
> Kristensen
> Sent: Thursday, September 22, 2005 1:30 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Help with a view
Thank you for responding, Daryl,
Am 22.09.2005 um 16:45 schrieb Daryl Richter:
Axel Rau wrote:
Hi SQLers,
I have a fk from address to network and try to update the foreign key
column to point at the network, "it belongs to":
CREATE TABLE network (
id cidr PRIMARY KEY , -- 'PK,
I've created a view 'principals' that gives me this output:
pgslekt=> select * from principals where event=15821;
person | event | place | sort_date | tag_type
+---+---++--
2 | 15821 | 1152 | 1999-09-17 |4
3 | 15821 | 1152 | 1999-09-17 |
I'm in the final stages of porting a large body of ESQL software from
Informix to PostgreSQL (V8). The last few Informix-based functions
involve Informix descriptor areas to insert rows into a table. I've
sorted out the logic for using PostgreSQL descriptor areas for select
statements. How do y
Axel Rau wrote:
Hi SQLers,
I have a fk from address to network and try to update the foreign key
column to point at the network, "it belongs to":
CREATE TABLE network (
id cidr PRIMARY KEY , -- 'PK, ,IPv4/6 Network address'
)
CREATE TABLE address (
id inet PRIMAR
O "Michael Hφller" έγραψε στις Sep 22, 2005 :
>
>
> Hello,
>
> I like to automate a daily check and like to run select statement via
> cron but this seems to be more tricky than I thought
>
> I tried the following:
> su postgres -c "select count(*) from TABLE where xx;"
Firstoff, 'sel
am 22.09.2005, um 15:55:53 +0200 mailte "Michael Höller" folgendes:
>
>
> Hello,
>
> I like to automate a daily check and like to run select statement via
> cron but this seems to be more tricky than I thought
>
> I tried the following:
> su postgres -c "select count(*) from TABLE where xx
Hi Michael,
On Thursday 22 September 2005 15:55, Michael Höller wrote:
| I like to automate a daily check and like to run select statement via
| cron but this seems to be more tricky than I thought
|
| I tried the following:
| su postgres -c "select count(*) from TABLE where xx;"
you mean
Hello,
I like to automate a daily check and like to run select statement via
cron but this seems to be more tricky than I thought
I tried the following:
su postgres -c "select count(*) from TABLE where xx;"
I have the probelm that I am allways asked for the password - I did not
find a
On 22.09.2005 11:47, [EMAIL PROTECTED] wrote:
How would you use it to only dump / restore the views? I don't want any
database tables.
Please RTFM. But because I'm such a nice guy:
Create a binary dump of the schema:
pg_dump -v -s -i -F c -Z 9 -U -f /tmp/dump.bin
Use the -l option of pg_re
Hi SQLers,
I have a fk from address to network and try to update the foreign key
column to point at the network, "it belongs to":
CREATE TABLE network (
id cidr PRIMARY KEY , -- 'PK, ,IPv4/6 Network address'
)
CREATE TABLE address (
id inet PRIMARY KEY , -
On 22.09.2005 10:37, [EMAIL PROTECTED] wrote:
Is there a maybe a tool that I can use to copy views as-is from one database
into another?
pg_dump and pg_restore :)
---(end of broadcast)---
TIP 4: Have you searched our list archives?
use pg_dump and pg_restore :)
On 22.09.2005 10:37, [EMAIL PROTECTED] wrote:
Hi Guys,
I'm using PostGreSQL with a Java project since I'm a proffesional Java
developer.
I've a database that have about 120 views in PostGreSQL 7.0 that I need to
copy into PostGreSQL 8.0. I can copy them one-by-one
This message was cancelled from within Mozilla.
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Hi Guys,
I'm using PostGreSQL with a Java project since I'm a proffesional Java
developer.
I've a database that have about 120 views in PostGreSQL 7.0 that I need to
copy into PostGreSQL 8.0. I can copy them one-by-one in pgAdmin but I don't
have the time! Is there a maybe a tool that I can use t
29 matches
Mail list logo