agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Dirk Lütjens <dirk@luedi.tng.oche.de>
To: postgres@postgres.Berkeley.EDU
Subject: different questions
Date: 29 Aug 1995 03:41:00 +0100
Message-ID: <5smCBOGPJAB@luedi.tng.oche.de> (raw)
Hello,
my Name is Dirk, and I'm new in working with postgres 4.2. Therefor there
are a lot of questions for me. I've already read the manual, the manpages,
the tutorial and other papers related to postgres, but didn't fond the
answers to my questions.
I'm working with Linux 1.2.6 on a i486.
1.) I like to create a new datatype e.g. with
define function circle_in
(language ="c", returntype =circle)
arg is (any)
as "/usr/local/postgres/src/examples/circle.o" \g
define function circle_out
(language ="c", returntype =any)
arg is (any)
as "/usr/local/postgres/src/examples/circle.o" \g
define type circle
(internallength = 24,
input = circle_in, output = circle_out) \g
and correct C-Functions.
There is no problem with the datatype. But what to do if the input data
to circle_in has not the correct form. e.g. I would like to make a range
check in the circle_in c-function. How can I tell postgres, not to append
the new tuple with this bad data. Returning a NULL don't work.
2.) Isn't there another possibility to create complexe user types
except converting the abstract data to a string, sending it as a String
to postgres, converting it to abstract data, and vice versa.
3.) How to handle portals?
a.)Let's think I created a class with
create Name (Familiename=string, Name = string, ...)\g
and filled it with usefull data
append Name (Familiename="Bollo", Name = "Hain", ...)\g
append Name (Familiename="Tull", Name ="Jethro", ....)\g
I started a query with
begin\g
retrieve portal test (Name.all)\g
fetch 1 in test\g
I got
---------------------------------------------------
| Familiename | Name | ...
---------------------------------------------------
| Bollo | Hain | ...
---------------------------------------------------
again
fetch 1 in test\g
---------------------------------------------------
| Familiename | Name | ...
---------------------------------------------------
| Tull | Jethro | ...
---------------------------------------------------
The next fetch will produce only the header
fetch 1 in test\g
---------------------------------------------------
| Familiename | Name | ...
---------------------------------------------------
and a fetch backward don't work correct
fetch backward 1 in test\g
---------------------------------------------------
| Familiename | Name | ...
---------------------------------------------------
Closing the portal will produce
close test\g
NOTICE:Aug 29 02:51:35:PortalHeapMemoryFree: 0x1d6f90 not in alloc set!
NOTICE:Aug 29 02:51:35:PortalHeapMemoryFree: 0x1d6f50 not in alloc set!
WHY, and how to get around this?
b.) In the postgres related paper "The Design of Postgres" is written:
" ...
replace EMP(salary=NewSalary)
where EMP.name="Smith"
fetch 20 into P
The Replace command modifies Smith's tuple in the EMP relation and
the Fetch command synchronizes the buffer ... "
But not in my version. When I replace a tuple in the database and
try to get the updated tuple out of the database with
fetch backward 1 in P\g
fetch 1 in P\g
I'll get the old version. After
close P\g
end\g
begin\g
retrieve ...
fetch 20 into P\g
the updated tuple is ok. How to get around first ending the transaction?
4.) Is there anybody out there?
I'am subscribed to the postgres newsgroup since one month. But
I got only one mail with a question. I would like to read the
answers too, if there are any, or are the answers privat ?-)
Huh, that was a long one. I hope somebody out there can help me.
Hope to hear something
Dirk
## CrossPoint v3.02 ##
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: dirk@luedi.tng.oche.de
Subject: Re: different questions
In-Reply-To: <5smCBOGPJAB@luedi.tng.oche.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox