agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
different questions
3+ messages / 3 participants
[nested] [flat]

* different questions
@ 1995-08-29 02:41 Dirk Lütjens <dirk@luedi.tng.oche.de>
  1995-08-29 05:20 ` Re: different questions Jolly Chen <jolly@postgres.Berkeley.EDU>
  1995-08-30 14:51 ` Re: different questions Wojtek Bogusz <Wojtek.Bogusz@fuw.edu.pl>
  0 siblings, 2 replies; 3+ messages in thread

From: Dirk Lütjens @ 1995-08-29 02:41 UTC (permalink / raw)
  To: legacy

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/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: different questions
  1995-08-29 02:41 different questions Dirk Lütjens <dirk@luedi.tng.oche.de>
@ 1995-08-29 05:20 ` Jolly Chen <jolly@postgres.Berkeley.EDU>
  1 sibling, 0 replies; 3+ messages in thread

From: Jolly Chen @ 1995-08-29 05:20 UTC (permalink / raw)
  To: Dirk L tjens <dirk@luedi.tng.oche.de>; +Cc: legacy


> 
> 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. 
> 

There's essentially *NO* support for postgres v4r2 left at Berkeley.
Andrew Yu and I have released beta versions of a SQL-speaking postgres
called postgres95.  For information about postgres95, check out our home page
at: 
	http://s2k-ftp.cs.berkeley.edu:8000/postgres95

Unless you have a pressing need to use the POSTQUEL query language, you
should consider using postgres95 instead of postgres v4.2.  Although
there is no official support for postgres95 either, there is more
traffic on the postgres95 mailing list.  Andrew and I monitor the list
and in the few free moments we have, we occasionally answer questions
and fix bugs.  

- Jolly Chen


==============================================================================
   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/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: different questions
  1995-08-29 02:41 different questions Dirk Lütjens <dirk@luedi.tng.oche.de>
@ 1995-08-30 14:51 ` Wojtek Bogusz <Wojtek.Bogusz@fuw.edu.pl>
  1 sibling, 0 replies; 3+ messages in thread

From: Wojtek Bogusz @ 1995-08-30 14:51 UTC (permalink / raw)
  To: dirk@luedi.tng.oche.de; +Cc: legacy


Hi,

> But what to do if the input data to circle_in has not the correct form

You can use function elog(type, format, var, ...). In order to do it  
#include "utils/log.h" in your C source. type can have a value (from 
log.h):

#define NOTICE  0       /* random info - no special action */
#define WARN    -1      /* Warning error - return to known state */
#define FATAL   1       /* Fatal error - abort process */

So WARN will stop inserting data to the DB and FATAL will also abort
postgres backend. Arguments "format, var, ..." are similar to printf
arguments.

> 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. 

I think it is the right and only way :-).

Regards and good luck,
Wojtek Bogusz
+---------------------------------------------------------------------------+
| e-mail address:          | Warsaw  University | Hoza 69; Warszawa; Poland |
| Wojtek.Bogusz@fuw.edu.pl | Physics Department | tel.(+48)(2)6283031x149   |
+---------------------------------------------------------------------------+
      finger -l bogusz@fizyk.fuw.edu.pl    for  PGP  Public  Key
           http://info.fuw.edu.pl/persons/wojtek_bogusz.html

==============================================================================
   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/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1995-08-30 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1995-08-29 02:41 different questions Dirk Lütjens <dirk@luedi.tng.oche.de>
1995-08-29 05:20 ` Jolly Chen <jolly@postgres.Berkeley.EDU>
1995-08-30 14:51 ` Wojtek Bogusz <Wojtek.Bogusz@fuw.edu.pl>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox