r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[PgSQL] PostgreSQL and REBOL

Oldes
2-Mar-2007
[28x6]
but first load correct charset, for example:
ucs2/load-rules "ISO-8859-1"
or let the sql server know, what encoding you are using (that it's 
not UTF8)
this should the best way (I just don't remember the correct command)
in MySQL I for example use: "SET character_set_client = cp1250"
http://www.postgresql.org/docs/7.4/static/multibyte.html
if you set the encoding on the server side, you don't need to convert 
your strings in Rebol but let the server to do that job
Janeks
2-Mar-2007
[34]
It seems for me too the best aproach too.

One another case where to use encoding funcions could be PDF maker 
- I had trouble to get pdf output into special characters of my language.
Oldes
2-Mar-2007
[35]
here are charset ids you can load into my scripts: print read http://box.lebeda.ws/~hmm/rebol/projects/ucs2/latest/charmaps.rb
Gabriele
3-Mar-2007
[36]
janeks: unfortunately the pdf format does not support unicode, so 
that's not trivial to do... i will do it, eventually.
DaveC
29-May-2007
[37]
I've been using  pgsql-protocol (r090)  to store HTML reports into 
the DB. 


It can write a large compressed string into a text column ok. Trying 
to read the data back causes the program to hang. The length of the 
stored string returns 182514 chars. (In psql: SELECT length(html) 
FROM reports....)

Test Code;

sql: {SELECT html FROM reports.html_reports WHERE ticket = '2007-756-fcw'}
insert db-port sql
html: first db-port
.... rest of test program never gets executed.

Does anyone know if this a known behaviour? Thanks

For information, if I select any other column, the program runs as 
expected. The data is these columns is a lot smaller in length.
Dockimbel
29-May-2007
[38x2]
They might be several reasons why this don't work. Try using LIMIT 
as a cheap workaround : http://pgsqld.active-venture.com/queries-limit.html
If this don't work, tell me what Postgres server version are you 
using, I'll try to reproduce the error.
DaveC
29-May-2007
[40]
Ok thanks. I'll double check the exact number tommorrow, but it's 
the 8.1 series. LIMIT would be a good idea, but the query returns 
only one row. It's the amount of data in the one column that is the 
problem. (Whole HTML reports in one chunk). I was thinking that I 
should split up the report into a set of smaller chunks as it gets 
generated  anyway.


I'll give you some more info tommorrow. I appreciate you are busy 
with Cheyenne, so thanks for your time.
Dockimbel
29-May-2007
[41]
No problem, I'm usually much more productive under pressure ;-)
Graham
20-Nov-2007
[42]
What's the current status of the postgresql driver   ?   Should one 
use mysql instead?
Ashley
20-Nov-2007
[43]
Or SQLite?
Graham
20-Nov-2007
[44x2]
Not SQLite ... as I need something that is not memory based.
Got databases over 2Gb in size
Pekr
21-Nov-2007
[46x3]
SQLite is not memory based imo. It was RebDB. SQLite is the coolest 
thing on earth for the purpose it is supposed to serve :-) I mean 
- small, embeddable SQL engine. MySQLLib is not good solution imo, 
as it does not use SQL syntax and is not even free for embedded stuff.
There is one defficiency with SQLite - it is one user solution. Well, 
you can lock iirc, on file level (yes, even records), but SQL requests 
are not serialised, so you have to think twice, when more than one 
client would connect to database.
As for PostGress, IIRC the driver was in better state than the one 
of mySQL? It even used continual parsing. Doc said later on even 
mySQL driver will be rewritten that way, and maybe it already is, 
dunno.
Graham
21-Nov-2007
[49x2]
Oh ... my bad.
I will have multiple clients accessing the database .. webserver, 
 update utiliities and main engine
Will
21-Nov-2007
[51]
Graham, Dock's Mysql driver run on eavy tasks without a hitch 8)
Graham
21-Nov-2007
[52x2]
I'm just not sure that Mysql's license will eventually catch doc's 
work as well.
So, my preference is for postgresql if I can.
xavier
27-Nov-2007
[54]
i have experienced a sort of problem : i needed a native driver for 
sql server in rebol because odbc wasnt suitable.  Does this exist 
or its not possible ?
Graham
27-Nov-2007
[55]
I think sql server is only odbc
xavier
28-Nov-2007
[56]
yes, what a pity.  i wonder how you can write a driver for a database 
.... i d like to try to do it just for fun
Brock
28-Nov-2007
[57]
I've always wondered the same thing.  Same with creating ports of 
other language functions or custome controls (widgets) etc.
sqlab
28-Nov-2007
[58]
do you mean MS sql server?

Galt Barber wrote an SQL -Proxy for MS-SQL7 a few years ago. Modifying 
his script I was able to snoop the connections to the Caché DB too.
BrianH
29-Nov-2007
[59]
There is a native non-odbc client library for ms sql that is fast. 
There is also a TCP line protocol to access it.
xavier
2-Dec-2007
[60]
can u tell me where is it ?
BrianH
2-Dec-2007
[61x3]
http://www.microsoft.com/downloads/details.aspx?FamilyId=DF0BA5AA-B4BD-4705-AA0A-B477BA72A9CB&DisplayLang=en#SNAC
That is the native client. Tell us if you have any luck with it.
By the way, ODBC and OLEDB are the native access methods of MS SQL 
Server - they are not an add-on layer. The tcp line protocol is the 
same protocol that the client libraries use. I think there is a few 
open source libraries that support the tcp connections (such as FreeTDS), 
though they may not be very current. You might be able to look at 
their code and docs to figure out the protocol.
Pekr
3-Dec-2007
[64]
my friend uses MSSQL with its command line tool ....
BrianH
3-Dec-2007
[65]
Even the command line tools connect through oledb or odbc.
xavier
3-Dec-2007
[66]
ok i have the dll and i wonder what to do now .... if anyone can 
give me informations ....
Maarten
4-Dec-2007
[67]
If you have Command or the SDK write a wrapper using C Callbacks 
(google for that + rebol) and the /Library component
xavier
5-Dec-2007
[68]
.
MikeL
28-Mar-2011
[69]
I am trying PGSQL with Doc's protocol and getting 'open pgsql'  error 
"** Script Error: find expected series argument of type: series object 
port bitse
t

** Near: fast-query: either args: find port/target"     This is Postgres 
9.0 recently downloaded.   Anyone having success with it?
Dockimbel
28-Mar-2011
[70]
Have you provided a database name in the connection URL?
MikeL
28-Mar-2011
[71x4]
Thanks Kaj.... looks like the NIC MAC is the only reliable one that 
meets the criteria.
ouch wrong group
Doc I tried db: open pgsql://postgres:[xxxxxxxx-:-127-:-0-:-0-:-1]:5432/postgres/ 
 where postgres is listed as a db on  pgAdmin III
Ouch it's the trailing slash
Dockimbel
28-Mar-2011
[75x2]
Btw, you only need to provide the port-id if it's not the default 
one (5432).
Let us know if it works ok with PostgreSQL v9.0. I haven't tested 
it since v7.3.
MikeL
28-Mar-2011
[77]
Will do.  Thanks for your work on this enabler ... it's a long list 
of your work that i leverage.  [looking for the donate button ....]