Re: [GENERAL] psql and Emacs on Windows

2009-08-08 Thread Wenjian Yang
Thanks for the replies.

I tried Cygwin and unfortunately failed to get it to work with the "native"
emacs binary for windows. I didn't spend too much time to try though, since
the version of postgresql with cygwin is still 8.2.*, and I'm not sure how
good the future support will be...

I did try another option, using both emacs and psql from Portable Ubuntu,
that works fine as expected. The version of psql is 8.3. Now, I need to see
how well it can connect to other databases from within Ubuntu, ;-) But the
worst case the user can use two emacs (from windows and from Ubuntu) if they
have to.

It would be nice to have native psql for Windows and native emacs for
Windows work out of box in the future though.

Thanks again.

Wenjian


On Fri, Aug 7, 2009 at 1:12 PM, Bill Bartlett <
bbartl...@softwareanalytics.com> wrote:

> On Friday, August 07, 2009 12:44 PM, Joshua D. Drake wrote:
> > On Fri, 2009-08-07 at 17:36 +0100, Sam Mason wrote:
> > > On Fri, Aug 07, 2009 at 11:11:10AM -0500, Wenjian Yang wrote:
> > > > We currently installed emacs 23.1 and PostgreSQL 8.4.0 for Windows on
> a
> > > > windows desktop. When issue "sql-postgres" in emacs, after providing
> > > > User/Password/Database/Server, nothing happens. There is no prompt
> from
> > > > emacs. Checking the server log, it doesn't seem to have received any
> > > > connection request.
> > >
> > > The current setup on my windows box uses the psql that comes with
> > > cygwin.  Unfortunately I don't use it enough to remember the details of
> > > how or why I settled on this setup.
> >
> > readline?
> >
>
> Yes, the problem is readline.  When running the "native" psql.exe from
> inside
> any sort of a "shell" program on Windows (such as from inside emacs, rxvt,
> remote SSH command line, etc.), psql thinks it is running in batch mode so
> you
> see no prompts.  It is indeed running, but you'll see no interactive
> information.
>
> From my 8/4/2007 response to a similar posting:
>
> (start)
> We use the Cygwin version of the psql.exe program under Windows instead of
> the
> native psql.exe program, even though the rest of the PostgreSQL
> installation
> uses the standard native Windows versions of all the other PostgreSQL
> components
> (database, tools, etc.).  (So before I get flamed, I want to clarify that
> the
> ONLY component of PostgreSQL that we use from Cygwin is psql.exe, and it's
> run
> from an alternate directory.)
>
> The main advantage that we get by using the Cygwin version of psql is that
> is
> runs in "interactive" mode regardless of how it is run, whereas the native
> psql
> program runs in non-interactive mode (showing almost no output, no prompts,
> no
> readline support, etc.) when run from most "shell" programs.  We frequently
> run
> psql via a remote SSH connection or from the RXVT terminal program or from
> inside Emacs, and in all of these cases the native psql program runs in
> non-interactive mode whereas the Cygwin version of psql is
> fully-functional."
> (end)
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>


[GENERAL] psql and Emacs on Windows

2009-08-07 Thread Wenjian Yang
Hi,

I'm trying to get more users to use PostgreSQL more often. Some of them are
familiar using the sql-mode in Emacs to access MS-SQL and Oracle from
Windows Desktops, but it doesn't work for PostgreSQL.

We currently installed emacs 23.1 and PostgreSQL 8.4.0 for Windows on a
windows desktop. When issue "sql-postgres" in emacs, after providing
User/Password/Database/Server, nothing happens. There is no prompt from
emacs. Checking the server log, it doesn't seem to have received any
connection request.

The above works fine on a linux box using emacs to access PostgreSQL.

I'm also sending the question to the emacs help list, since I'm not an
expert in emacs either.

Thanks.

Wenjian Yang


[GENERAL] give a hand to a user having trouble with MySQL?

2008-02-25 Thread Wenjian Yang
Came across a blog from Ovid, one of the Perl gurus at BBC.
http://use.perl.org/~Ovid/journal/35752?from=rss

Quote

"They're not kidding, either. Subquery optimization in MySQL is terribly
broken,
as we've discovered today. We have Matt Trout in for some consulting and
even ridiculously stupid subqueries have terrible query plans, forcing us to
to consider nasty workarounds, one of which is called "PostgreSQL"."

Even though he counts PostgreSQL as one of th enasty workarounds, maybe we
should give them a helping hand?

Wenjian


Re: [GENERAL] LDAP configuration problem

2006-12-29 Thread Wenjian Yang

Magnus,

You are absolutely correct. Sorry that I didn't see the last line since
GMAIL hid it for me.

The rpms for Fedora 6 from www.postgresql.com don't seem to have the LDAP
support built-in, it shows that

invalid entry in file "/pub/pgsql/data/pg_hba.conf" at line 79, token "ldap"

But after download the source, recompile with "--with-ldap", it worked
perfectly. I wonder if this could be built in the rpm as the default in the
future.

Thanks and happy new year.

Wenjian


On 12/29/06, Magnus Hagander <[EMAIL PROTECTED]> wrote:


Wenjian Yang wrote:
>
> Sorry, below are the lines in the log file:
>
> LOG:  invalid entry in file "/pub/pgsql/data/pg_hba.conf" at line 78,
> token "ldap://dc.domain.com/dc=domain^Adc=com;DOMAIN\";
> FATAL:  missing or erroneous pg_hba.conf file
> HINT:  See server log for details.
>
> And the pg_hba.conf line 78, is
>
> host  all  all  0.0.0.0 <http://0.0.0.0/>   0.0.0.0 <http://0.0.0.0/>
> ldap://dc.domain.com/dc=domain,dc=com/DOMAIN\
>
> Since the previous email, I had the same problem on another FC6 x86_64
box.

What does the message show if you change the line per my suggestion
below? (note the extra ldap token)

//Magnus


> On 12/29/06, *Magnus Hagander* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Wenjian Yang wrote:
> > Hi,
> >
> > I've just installed 8.2.0 from rpms on FC6 i386 and wanted to try
out
> > the built-in LDAP support.
> >
> > The following LDAP authentication was added to "pg_hba.conf"
> >
> > host  all  all  0.0.0.0 <http://0.0.0.0> <http://0.0.0.0>  0.0.0.0
> <http://0.0.0.0> <http://0.0.0.0>
> > ldap://dc.domain.com/dc=domain,dc=com/DOMAIN\
> >
> > However when trying to connect from another machine, it gave the
error
> > "FATAL: missing or erroneous pg_hba.conf file".
> >
> > Looking at the server log, the comma in "dc=domain,dc=com" has
> become ^A
> > while all the other characters are intact.
> >
> > Does this have to do with some other packages or I specified the
the
> > line wrong? Thanks in advance.
>
>
> The first thing you've done wrong is not actually include the log
lines
> that had something to do with it. What are those server log lines?
>
> Anyway, I beleive you should write:
> host all all 0.0.0.0 <http://0.0.0.0> 0.0.0.0 <http://0.0.0.0> ldap
> ldap://dc.domain.com/dc=domain,dc=com/DOMAIN\
>
>
> //Magnus
>
>




Re: [GENERAL] LDAP configuration problem

2006-12-28 Thread Wenjian Yang

Sorry, below are the lines in the log file:

LOG:  invalid entry in file "/pub/pgsql/data/pg_hba.conf" at line 78, token
"ldap://dc.domain.com/dc=domain^Adc=com;DOMAIN\";
FATAL:  missing or erroneous pg_hba.conf file
HINT:  See server log for details.

And the pg_hba.conf line 78, is

host  all  all  0.0.0.0   0.0.0.0
ldap://dc.domain.com/dc=domain,dc=com/DOMAIN\

Since the previous email, I had the same problem on another FC6 x86_64 box.

Thanks.

Wenjian

On 12/29/06, Magnus Hagander <[EMAIL PROTECTED]> wrote:


Wenjian Yang wrote:
> Hi,
>
> I've just installed 8.2.0 from rpms on FC6 i386 and wanted to try out
> the built-in LDAP support.
>
> The following LDAP authentication was added to "pg_hba.conf"
>
> host  all  all  0.0.0.0 <http://0.0.0.0>  0.0.0.0 <http://0.0.0.0>
> ldap://dc.domain.com/dc=domain,dc=com/DOMAIN\
>
> However when trying to connect from another machine, it gave the error
> "FATAL: missing or erroneous pg_hba.conf file".
>
> Looking at the server log, the comma in "dc=domain,dc=com" has become ^A
> while all the other characters are intact.
>
> Does this have to do with some other packages or I specified the the
> line wrong? Thanks in advance.


The first thing you've done wrong is not actually include the log lines
that had something to do with it. What are those server log lines?

Anyway, I beleive you should write:
host all all 0.0.0.0 0.0.0.0 ldap
ldap://dc.domain.com/dc=domain,dc=com/DOMAIN\


//Magnus



[GENERAL] LDAP configuration problem

2006-12-28 Thread Wenjian Yang

Hi,

I've just installed 8.2.0 from rpms on FC6 i386 and wanted to try out the
built-in LDAP support.

The following LDAP authentication was added to "pg_hba.conf"

host  all  all  0.0.0.0  0.0.0.0
ldap://dc.domain.com/dc=domain,dc=com/DOMAIN\

However when trying to connect from another machine, it gave the error
"FATAL: missing or erroneous pg_hba.conf file".

Looking at the server log, the comma in "dc=domain,dc=com" has become ^A
while all the other characters are intact.

Does this have to do with some other packages or I specified the the line
wrong? Thanks in advance.

Wenjian


[GENERAL] best ways to handle large matrix data

2006-08-02 Thread Wenjian Yang
Hi, this maybe a more general question and not limited to postgresql.We are generating some matrix like data, e.g. one object will have a fixed number 10 values, and we have currently 300 objects. We can visualized the data as a 10 by 300 matrix, and each object/column has an identifier, each row has an identifier as well. The number of rows are fixed, but columns will increase by time. The data is type double.
The queries that we encounter most often are that given a set of rowids, e.g. (1000, 2000, 2001, 3241), retrieve the slice of the data. (the set of rowids are usually generated from SQL)I know that NetCDF and HDF5 can be used to strore such information, but is there any way we can save the matrix in postgres database and have easy retrieval and addition without sacrificing too much space? If not, I guess I'll try to write some functions in postgres to do some retrieval from netcdf. 


Thanks.Wenjian