[SQL] SELECT statement within libpq

2003-05-31 Thread David Klugmann
Hi

I'm knew to postgres and I got my first C postgres connection working from 
the examples in the documentation.

In that it does a BEGIN and a DECLARE CURSOR FOR SELECT et.c. This seems a 
long way to go about getting back data each time.

Is it not possible to just do a straight select and not a transaction and a 
cursor ?

Also does anyone have any generic routines for handling results of all types 
of select.

Many thanks

David

_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[SQL] View unique rowid

2005-06-01 Thread David Klugmann


Hi
Is it possible to refer to a unique row identifier on a view ?

I have the following view but in a subsequent select I need to refer to
each row's unique identifier and I know oid's are not valid for a view.

create view persontransit
as
select personid, planet, name as aspectname, position as planetposition,
position+angle as transitposition
from personplanet, aspect
union
select personid, planet, name as aspectname, position as planetposition,
position-angle as transitposition
from personplanet, aspect
where name != 'OPPOSITION';

Many thanks

David



---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [SQL] View unique rowid

2005-06-01 Thread David Klugmann

Many thanks

I think the problem with using the oid from the primary table is that may 
rows in the view definition will get the same oid because of the union.


Thanks very much anyway.

I will look at the temporary sequence although I am not sure if sequences 
work with views.


Regards

David


From: Rafa Couto <[EMAIL PROTECTED]>
Reply-To: Rafa Couto <[EMAIL PROTECTED]>
To: David Klugmann <[EMAIL PROTECTED]>
CC: [email protected]
Subject: Re: [SQL] View unique rowid
Date: Wed, 1 Jun 2005 16:53:19 +0200

> Is it possible to refer to a unique row identifier on a view ?
>
> I have the following view but in a subsequent select I need to refer to
> each row's unique identifier and I know oid's are not valid for a view.


You can get an oid from some table in view definition. May be it
results to resolve your problem...

You can also try "create temp sequence" (review
http://archives.postgresql.org/pgsql-sql/2005-05/msg00126.php)


select 'saludos';

--
Rafa Couto (caligari)
mailto:[EMAIL PROTECTED]

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster




---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[SQL] Unsubscribe

2006-09-20 Thread David Klugmann





---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[SQL] unsubscribe

2007-02-08 Thread David Klugmann

unsubscribe



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly