Re: [HACKERS] Feature proposal: www_fdw

2011-11-27 Thread Alexander Soudakov
Hello.

I finished developing www_fdw:
https://github.com/cyga/www_fdw/

It has docs/examples:
https://github.com/cyga/www_fdw/wiki

I haven't upload it to pgxn or pgfoundry yet.

I want to ask for the following 2 things:
1. testing from community;
2. how can I add my extension to official fdw list:
http://wiki.postgresql.org/wiki/Foreign_data_wrappers
Is there any procedure for it?



On Thu, Sep 29, 2011 at 1:20 AM, Kevin Grittner
kevin.gritt...@wicourts.gov wrote:
 Florian Pflug f...@phlo.org wrote:
 On Sep28, 2011, at 15:32 , Alexander Soudakov wrote:
 Here you can find www_fdw feature documentation:
 http://wiki.postgresql.org/wiki/WWW_FDW

 Certainly looks useful (as a third-party extension, as others have
 already pointed out)

 Our programmers agree that it is likely to be useful here.  I agree
 that it should be an extension.

 What I didn't quite understand is how one would pass (dynamic)
 parameters for a GET request. For example, not too long ago I
 needed to access the Google Maps API from postgres. I ended up
 using pl/python, and now wonder if your FDW would support that
 use-case.

 I would assume that the usual ? to start parameters and  between
 parameters would be used.  For example, with Google Maps:

 http://maps.google.com/maps?hl=enie=UTF8hq=hnear=Madison,+Dane,+Wisconsinll=43.074684,-89.38188spn=0.003006,0.00383t=hz=18layer=ccbll=43.07468,-89.381742panoid=LhJ-PFHVzxRguJ6h616mmQcbp=12,355.53,,0,-1.32

 -Kevin




-- 
Alexander Soudakov
Software Developer
email: cyga...@gmail.com
skype: asudakov

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Feature proposal: www_fdw

2011-11-27 Thread Alexander Soudakov
Also,

in addition to:
 I want to ask for the following 2 things:
 1. testing from community;
 2. how can I add my extension to official fdw list:
 http://wiki.postgresql.org/wiki/Foreign_data_wrappers
 Is there any procedure for it?

Can I have it included in 9.2?

On Sun, Nov 27, 2011 at 10:28 PM, Alexander Soudakov cyga...@gmail.com wrote:
 Hello.

 I finished developing www_fdw:
 https://github.com/cyga/www_fdw/

 It has docs/examples:
 https://github.com/cyga/www_fdw/wiki

 I haven't upload it to pgxn or pgfoundry yet.

 I want to ask for the following 2 things:
 1. testing from community;
 2. how can I add my extension to official fdw list:
 http://wiki.postgresql.org/wiki/Foreign_data_wrappers
 Is there any procedure for it?



 On Thu, Sep 29, 2011 at 1:20 AM, Kevin Grittner
 kevin.gritt...@wicourts.gov wrote:
 Florian Pflug f...@phlo.org wrote:
 On Sep28, 2011, at 15:32 , Alexander Soudakov wrote:
 Here you can find www_fdw feature documentation:
 http://wiki.postgresql.org/wiki/WWW_FDW

 Certainly looks useful (as a third-party extension, as others have
 already pointed out)

 Our programmers agree that it is likely to be useful here.  I agree
 that it should be an extension.

 What I didn't quite understand is how one would pass (dynamic)
 parameters for a GET request. For example, not too long ago I
 needed to access the Google Maps API from postgres. I ended up
 using pl/python, and now wonder if your FDW would support that
 use-case.

 I would assume that the usual ? to start parameters and  between
 parameters would be used.  For example, with Google Maps:

 http://maps.google.com/maps?hl=enie=UTF8hq=hnear=Madison,+Dane,+Wisconsinll=43.074684,-89.38188spn=0.003006,0.00383t=hz=18layer=ccbll=43.07468,-89.381742panoid=LhJ-PFHVzxRguJ6h616mmQcbp=12,355.53,,0,-1.32

 -Kevin




 --
 Alexander Soudakov
 Software Developer
 email: cyga...@gmail.com
 skype: asudakov




-- 
Alexander Soudakov
Software Developer
email: cyga...@gmail.com
skype: asudakov

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] trivial patch: foreign table either defines row type

2011-11-12 Thread Alexander Soudakov
Hello Hackers.

I attached trivial patch.

Foreign table either defines row type. I simply added this type to
hardcoded check.
I faced this limitation while developing www fdw feature
(http://wiki.postgresql.org/wiki/WWW_FDW).


-- 
Alexander Soudakov
Software Developer
email: cyga...@gmail.com
skype: asudakov
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c
index 578cae5..f579d98 100644
--- a/src/pl/plpgsql/src/pl_comp.c
+++ b/src/pl/plpgsql/src/pl_comp.c
@@ -1940,11 +1940,12 @@ build_row_from_class(Oid classOid)
 	classStruct = RelationGetForm(rel);
 	relname = RelationGetRelationName(rel);
 
-	/* accept relation, sequence, view, or composite type entries */
+	/* accept relation, sequence, view, composite type or foreign table entries */
 	if (classStruct-relkind != RELKIND_RELATION 
 		classStruct-relkind != RELKIND_SEQUENCE 
 		classStruct-relkind != RELKIND_VIEW 
-		classStruct-relkind != RELKIND_COMPOSITE_TYPE)
+		classStruct-relkind != RELKIND_COMPOSITE_TYPE 
+		classStruct-relkind != RELKIND_FOREIGN_TABLE)
 		ereport(ERROR,
 (errcode(ERRCODE_WRONG_OBJECT_TYPE),
  errmsg(relation \%s\ is not a table, relname)));

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Feature proposal: www_fdw

2011-09-29 Thread Alexander Soudakov
On Thu, Sep 29, 2011 at 1:20 AM, Kevin Grittner
kevin.gritt...@wicourts.gov wrote:
 Florian Pflug f...@phlo.org wrote:
 On Sep28, 2011, at 15:32 , Alexander Soudakov wrote:
 Here you can find www_fdw feature documentation:
 http://wiki.postgresql.org/wiki/WWW_FDW

 Certainly looks useful (as a third-party extension, as others have
 already pointed out)

 Our programmers agree that it is likely to be useful here.  I agree
 that it should be an extension.

 What I didn't quite understand is how one would pass (dynamic)
 parameters for a GET request. For example, not too long ago I
 needed to access the Google Maps API from postgres. I ended up
 using pl/python, and now wonder if your FDW would support that
 use-case.

 I would assume that the usual ? to start parameters and  between
 parameters would be used.  For example, with Google Maps:

 http://maps.google.com/maps?hl=enie=UTF8hq=hnear=Madison,+Dane,+Wisconsinll=43.074684,-89.38188spn=0.003006,0.00383t=hz=18layer=ccbll=43.07468,-89.381742panoid=LhJ-PFHVzxRguJ6h616mmQcbp=12,355.53,,0,-1.32

 -Kevin


There would be an option to specify callback for forming request
(request_serialize_callback):
it would be passed with configuration parameters, details of the query
and action (currently it's only SELECT).
So it can:
* add specific parameters (like developer key)
* change column name to query parameter name (for eg: column name -
column, query parameter - q)
* create dynamic parameter

And return query string via output parameter uri.
Also I plan to add output parameter request of composite type for
future to use it for passing any post parameters (or some other http
headers specific to api).

-- 
Alexander Soudakov
Developer Programmer
email: cyga...@gmail.com
skype: asudakov

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Feature proposal: www_fdw

2011-09-28 Thread Alexander Soudakov
Greetings postgres hackers!

Here you can find www_fdw feature documentation:
http://wiki.postgresql.org/wiki/WWW_FDW

Looking forward for your feedback.

-- 
Alexander Soudakov
Developer Programmer
email: cyga...@gmail.com
skype: asudakov

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Feature proposal: www_fdw

2011-09-28 Thread Alexander Soudakov
On Wed, Sep 28, 2011 at 7:17 PM, David Fetter da...@fetter.org wrote:
 On Wed, Sep 28, 2011 at 05:32:37PM +0400, Alexander Soudakov wrote:
 Greetings postgres hackers!

 Here you can find www_fdw feature documentation:
 http://wiki.postgresql.org/wiki/WWW_FDW

 Looking forward for your feedback.

 Do you have some libraries you plan to base this on, or will you be
 hand-tooling it all?

I was planning to use 3rd party libraries for json/xml/yaml,
interactions with services. The same way as FWD from here
http://wiki.postgresql.org/wiki/Foreign_data_wrappers do.

But now I guess it might be a problem to include it under contrib
directory (same way as file_fdw), right?


 Cheers,
 David.
 --
 David Fetter da...@fetter.org http://fetter.org/
 Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
 Skype: davidfetter      XMPP: david.fet...@gmail.com
 iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

 Remember to vote!
 Consider donating to Postgres: http://www.postgresql.org/about/donate




-- 
Alexander Soudakov
Developer Programmer
email: cyga...@gmail.com
google talk: cyga...@gmail.com
jabber: asuda...@jabber.org
icq uin: 311516511
skype: asudakov

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Extension proposal: www_fdw

2011-09-28 Thread Alexander Soudakov
inline

On Wed, Sep 28, 2011 at 7:21 PM, Andrew Dunstan and...@dunslane.net wrote:


 On 09/28/2011 09:32 AM, Alexander Soudakov wrote:

 Greetings postgres hackers!

 Here you can find www_fdw feature documentation:
 http://wiki.postgresql.org/wiki/WWW_FDW

 Looking forward for your feedback.


 Why should this be a core feature, as the subject suggests? It could just be
 an extension, like other FDWs, no?


Subject?
I didn't mean this, truly speaking I missed this moment.
But now I guess it would be ok it to be extension like other FDWs.
What do I need to change this? Change subject as s/Feature/Extension/ ?


 cheers

 andrew




-- 
Alexander Soudakov
Developer Programmer
email: cyga...@gmail.com
google talk: cyga...@gmail.com
jabber: asuda...@jabber.org
icq uin: 311516511
skype: asudakov

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers