Joshua D. Drake | 1 Feb 02:41 2008

Re: Is PostGreSql's Data storage mechanism "inferior"?


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/
Alvaro Herrera | 1 Feb 03:16 2008

Re: PL/Tcl implementation

fschmidt escribiĆ³:
> 
> Why doesn't the PL/Tcl (and PL/Python) implementation use the SPI functions? 
> For example pltcl_set_tuple_values() calls NameStr() instead of SPI_fname()
> and heap_getattr() instead of SPI_getbinval().  Why?  This makes the code
> impossible to follow for someone who is not familiar with the postgres
> source and has only read the online documentation.

If you are reading the PL/Tcl source (i.e. the Postgres source, really),
you should definitely be using a source code cross-referencing system;
be it doxygen, or cscope, glimpse, or whatever tool fits the bill.  If
you cannot find out at a keystroke where to find the definition of
NameStr() you are doomed [to take a lot longer to understand what's
going on].

--

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Chander Ganesan | 1 Feb 03:19 2008

Re: Log file permissions?

Alvaro Herrera wrote:
Vivek Khera wrote:
On Jan 31, 2008, at 10:21 AM, Alvaro Herrera wrote:
I think you should be able to chmod the files after they have been created. The postmaster changes its umask to 0077, so no file is group-readable. I don't think is configurable either.
just move the logs into a subdir which has permissions applied to it, then not worry about the files inside, since nobody can break through the directory anyhow.
That doesn't work because the files won't be readable by anyone but the postgres user.
You could just write a cron job that periodically goes to the log directory and changes the permissions on the existing log files to allow reading by whatever group owns the log files, then make nagios a member of that group.  Even if the log file is currently in use, once you change the permissions, they should stick.  Of course, there would be a permission change lag between the time the log file switch occurs and the cron job runs...

As to Alvaro's recommendation of having a setting to change the log group, I think another idea would be to have a 'log_rotate_script' setting...thus allowing a script to be called with the log file name after a log file is rotated.  In such a case one could archive off existing files, and since the switch to a new log file had already occurred, also change permissions, etc if needed.
-- Chander Ganesan The Open Technology Group One Copley Parkway, Suite 210 Morrisville, NC 27560 Phone: 877-258-8987/919-463-0999 http://www.otg-nc.com
ahmadbasha.shaik | 1 Feb 06:38 2008

facing problems while loading lwpostgis.sql in PostGIS

Hi
 
I am facing problems while loading lwpostgis.sql in PostGIS. Below is a detailed explanation.
psql -d test -f /usr/share/lwpostgis.sql
 
/******************************************************************************/
ERROR:  could not access file "$libdir/liblwgeom.so.1.2": No such file or directory
ERROR:  current transaction is aborted, commands ignored until end of transaction block
/******************************************************************************/
 
Hence , I tried creating a simple test.sql which has the create replace functions for histogram. I have detailed the environmnent that we are
using, the statement of lwpostgis.sql we executed and the error encountered
 
Environment:
============
Operationg System : Red Hat Linux 3.4.5-2
Database : PostgreSQL 8.2.6
Extensions : geos-3.0.0, proj-4.6.0, postgis-1.2.1
 
test.sql (three sql commands that I have taken from lwpostgis.sql to check)
========

BEGIN;
 
CREATE OR REPLACE FUNCTION histogram2d_in(cstring)
        RETURNS histogram2d
        AS '$libdir/liblwgeom.so.1.2', 'lwhistogram2d_in'
        LANGUAGE 'C' IMMUTABLE STRICT; -- WITH (isstrict);
 
CREATE OR REPLACE FUNCTION histogram2d_out(histogram2d)
        RETURNS cstring
        AS '$libdir/liblwgeom.so.1.2', 'lwhistogram2d_out'
        LANGUAGE 'C' IMMUTABLE STRICT; -- WITH (isstrict);
 
CREATE TYPE histogram2d (
        alignment = double,
        internallength = variable,
        input = histogram2d_in,
        output = histogram2d_out,
        storage = main
);
 
COMMIT;
 
 
ERROR Encountered
================
 
BEGIN
psql:test.sql:6: NOTICE:  type "histogram2d" is not yet defined
DETAIL:  Creating a shell type definition.
psql:test.sql:6: ERROR:  could not access file "$libdir/liblwgeom.so.1.2": No such file or directory
psql:test.sql:11: ERROR:  current transaction is aborted, commands ignored until end of transaction block
psql:test.sql:19: ERROR:  current transaction is aborted, commands ignored until end of transaction block
ROLLBACK
 
Varions Options we tried:
==================
a) /usr/local/lib is present in /etc/ld.so.conf
b) ldconfig was executed
c) Changed the permissions $libdir i.e. /usr/lib/pgsql to 777
d) Hardcoded the path /usr/lib/pgsql in this test.sql
e) We also tried hardcoding the path /usr/lib/pgsql instead of $libdir in lwpostgis.sql when we tried loading functions and types in lwpostgis.sql
f) When I hardcode the path /usr/lib/pgsql - it gives the following error - could not load library "/usr/lib/pgsql/liblwgeom.so.1.2": /usr/lib/pgsql/liblwgeom.so.1.2: undefined symbol: nth
 
 

Can somebody please guide us or give directions what can be done.

P Please do not print this email unless it is absolutely necessary. Spread environmental awareness.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Stefan Schwarzer | 1 Feb 07:49 2008
Picon

Dump schema without the functions

Hi there,

how can I dump a schema with all tables, but without the functions? Is  
there a way to do it, or do I have to manually drop the functions  
later when having used the pg_restore?

Thanks for any advice,

Stef
Attachment (smime.p7s): application/pkcs7-signature, 2947 bytes
Tom Lane | 1 Feb 07:58 2008
Picon

Re: Is PostGreSql's Data storage mechanism "inferior"?

"Andrej Ricnik-Bay" <andrej.groups <at> gmail.com> writes:
> On 01/02/2008, Tony Caduto <tony_caduto <at> amsoftwaredesign.com> wrote:
>> The part about the BSD license is bogus. A BSD license is the most
>> desirable of any Open Source license and gives you the right to use
>> PostgreSQL in your commercial apps without worry.

> While I'm a big fan of the BSD license (for varied reasons) I think that
> OpenSource hardliners like RMS would argue that the BSD license is *NOT*
> in the true spirit of OpenSource *BECAUSE* of what you list as a bonus
> of it ... the locking down of benefits reaped from OpenSource not getting
> back into the stream.

The quoted article knocked *both* GPL and BSD as being "too open".  Too
open for whom, he didn't say.  The rest of the article is at about the
same quality level :-(  I have seldom seen such a sterling example of
cluelessness combined with FUD-spouting.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo <at> postgresql.org so that your
       message can get through to the mailing list cleanly

Adam Rich | 1 Feb 08:08 2008
Picon
Picon

Re: Dump schema without the functions

> how can I dump a schema with all tables, but without the functions? Is
> there a way to do it, or do I have to manually drop the functions
> later when having used the pg_restore?

Stef,
You can edit the data between dump and restore, to comment out the
function references. Or, you can use the "-L" argument with pg_restore
to provide a list of the specific items you want to restore.

For example:

pg_dump -Fc mydb > db.dump
pg_restore -l db.dump | grep -v FUNCTION > db.nofunc.dump
pg_restore -d newdb db.nofunc.dump

(assuming the word "FUNCTION" doesn't appear elsewhere in your schema 
object names.  If it does, you might try appending the schema, such as 
grep -v "FUNCTION public")

Adam

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

Tom Lane | 1 Feb 08:10 2008
Picon

Re: Dump schema without the functions

Stefan Schwarzer <stefan.schwarzer <at> grid.unep.ch> writes:
> how can I dump a schema with all tables, but without the functions?

There's no built-in single command for that.  You can accomplish it by
using pg_restore -l to make a list of objects, then edit the list,
then pg_restore -L to restore only the objects in the edited list.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo <at> postgresql.org so that your
       message can get through to the mailing list cleanly

Stefan Schwarzer | 1 Feb 08:31 2008
Picon

Re: Dump schema without the functions

>> how can I dump a schema with all tables, but without the functions?
>
> There's no built-in single command for that.  You can accomplish it by
> using pg_restore -l to make a list of objects, then edit the list,
> then pg_restore -L to restore only the objects in the edited list.

Hmmm.. I probably should have mentioned that it's not a "normal" dump,  
but one including imported shapefiles. So my dump comes from this:

	pg_dump -Fc ...

and - sorry, myself not being an expert - it seems to me that this  
file is not editable anymore.

When I try to dump the file in text form, it gets rather big, and when  
trying to import it, I get this:

server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
connection to server was lost

Stef

Attachment (smime.p7s): application/pkcs7-signature, 2947 bytes
Nicolas KOWALSKI | 1 Feb 11:06 2008
Picon

problem with ORDER BY

Hello,

I do not understand why the following ORDER BY statment does not work
as I would expect:

1) I defined a simple table with only one column, containing urls:

mon=> \d url
    Table "public.url"
 Column | Type | Modifiers
--------+------+-----------
 url    | text | not null
Indexes:
    "url_pkey" primary key, btree (url)

2) I populated it, some urls starting with https, others with http

3) When I want to sort them, I get this "strange" ordering:

mon=> SELECT * FROM url ORDER BY url asc ;
              url
-------------------------------
 http://imag.fr/
 https://gmail.com/
 https://mail.google.com/mail/
 https://www.sixxs.net/
 http://www.google.com/
 http://www.google.com/reader/
 http://www.google.fr/
 http://www.postgresql.org/
(8 rows)

Should'nt I get these values in the following order ?

 http://imag.fr/
 http://www.google.com/
 http://www.google.com/reader/
 http://www.google.fr/
 http://www.postgresql.org/
 https://gmail.com/
 https://mail.google.com/mail/
 https://www.sixxs.net/

Thanks,
--

-- 
Nicolas

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq


Gmane