[GENERAL] Executing SQL expression from C-functions

2011-01-28 Thread Jorge Arévalo
Hello, I need to write a C-function to extend my PostgreSQL server functionality. One of the arguments of that function is a string representing any PostgreSQL valid expression returning a number. For example: 3+5*cos(7.4)/8 7 2+2 log(34) degrees(0.5) power(9.0, 3.0) case when 8 2 then 1 when

[GENERAL] Fwd: RV: RV: DECRETO (ME LLEGÓ HOY)

2011-01-28 Thread Alfredo Torres
: *DECRETO METAFÍSICO * Les diré, que terminando de leerlosonó el teléfono del Apartamentoy pensando que fue casualidad, volví a leerlo y...!!sonó el celularahí les dejo eso.! Se los mando por las dudas.. LES COMENTO QUE A MI TAMBIÉN ME SONÓ EL TELÉFONO CUANDO TERMINÉ

Re: [GENERAL] Executing SQL expression from C-functions

2011-01-28 Thread Pavel Stehule
Hello see SPI interface http://www.postgresql.org/docs/8.4/interactive/spi-examples.html Regards Pavel Stehule 2011/1/28 Jorge Arévalo jorge.arev...@deimos-space.com: Hello, I need to write a C-function to extend my PostgreSQL server functionality. One of the arguments of that function is

[GENERAL] How best to load modules?

2011-01-28 Thread Steve White
Hello, all! What are best practices regarding the loading of postgresql modules, say from the contrib/ directory; specifically, with regard to portability? I would like to distribute an SQL script which loads a module, and works with as little further fiddling as possible. known options

Re: [GENERAL] Executing SQL expression from C-functions

2011-01-28 Thread Jorge Arévalo
2011/1/28 Pavel Stehule pavel.steh...@gmail.com: Hello see SPI interface http://www.postgresql.org/docs/8.4/interactive/spi-examples.html Regards Pavel Stehule Hi Pavel, Thanks a lot! Best regards, -- Jorge Arévalo Internet Mobilty Division, DEIMOS jorge.arev...@deimos-space.com

Re: [GENERAL] How best to load modules?

2011-01-28 Thread Dimitri Fontaine
Steve White swh...@aip.de writes: What are best practices regarding the loading of postgresql modules, say from the contrib/ directory; specifically, with regard to portability? I would like to distribute an SQL script which loads a module, and works with as little further fiddling as

Re: [GENERAL] Select query ignores index on large table

2011-01-28 Thread Michael Kemanetzis
Thanks, it did help. Now queries run in zero time. I had thought of doing thatbut since the same configuration was working ok on MSSQL I thought it should also here. Now with that index the server query times are a lot faster than MSSQL without it. Since it is working I will leave it like

Re: [GENERAL] Select query ignores index on large table

2011-01-28 Thread Michael Kemanetzis
I am answering just for the sake of answering your questions. What hubert depesz lubaczewski suggested had fixed the problem i had. I have other queries that need event_id to be the clustered index Veh_id is spread all over the table. (for veh_id 3 there are no records) Due to the spread of

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-28 Thread Andre Lopes
Hi, Another question about this subject. It is possible to cache this images from the database? In the future I will need to cache the pictures. If you have any knowledge about this, please give me a clue. Best Regards, On Wed, Jan 26, 2011 at 2:09 PM, Bill Moran wmo...@potentialtech.com

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-28 Thread rsmogura
Hi, In means of database, it is impossible. If you want to cache, add version or last modified column, then ask for changes and cache data locally. Kind regards, Radosław Smogura http://softperience.eu On Fri, 28 Jan 2011 13:32:31 +, Andre Lopes wrote: Hi, Another question about this

Re: [GENERAL] How best to load modules?

2011-01-28 Thread Steve White
Hi Dimitri! PGXS is interesting, but a bigger solution than I was looking for: ideally, some simple commands for loading the module from my .sql script. pg_config seems to be in yet another package, postgresql84-devel. It is a shell utility for getting such information. This is again far

Re: [GENERAL] Dumpall without OID

2011-01-28 Thread Girts Laudaks
Well, seems that everything is OK. There are no OIDs used from the application side but they still appear in the database tables, this was what made the confusion. Thanks, G. On 2011.01.27. 21:33, Adrian Klaver wrote: On 01/27/2011 04:52 AM, Girts Laudaks wrote: Hi, What could be the

Re: [GENERAL] Adding ddl audit trigger

2011-01-28 Thread Kenneth Buckler
You just need to log DDL, correct? Why not just edit postgres.conf and set log_statement to 'ddl'. See http://www.postgresql.org/docs/9.0/static/runtime-config-logging.html If you need to include username, database, etc, take a look at log_line_prefix on the same page. Ken On Wed, Jan 26,

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-28 Thread Dmitriy Igrishin
2011/1/28 Andre Lopes lopes80an...@gmail.com Hi, Another question about this subject. It is possible to cache this images from the database? In the future I will need to cache the pictures. If you have any knowledge about this, please give me a clue. Best Regards, How would you like to

Re: [GENERAL] Dumpall without OID

2011-01-28 Thread Adrian Klaver
On Friday 28 January 2011 4:54:18 am Girts Laudaks wrote: Well, seems that everything is OK. There are no OIDs used from the application side but they still appear in the database tables, this was what made the confusion. Thanks, G. OIDS on user tables have not been on by default since

Re: [GENERAL] Problem with restoring from backup on 9.0.2

2011-01-28 Thread hubert depesz lubaczewski
On Thu, Jan 27, 2011 at 10:23:52PM +, Thom Brown wrote: Depesz, did you ever resolve this? Robert Treat did some digging. Current status is: slav backup work as long as you don't enable hot standby. I will be working on omnipitr-backup-slave fix, but can't give you eta at the moment. Best

Re: [GENERAL] temporal period type and select distinct gives equality error

2011-01-28 Thread Jeff Davis
On Thu, 2011-01-27 at 07:32 -0500, Arturo Perez wrote: I thought I saw that in CVS but when I checked it out and installed it the error did not go away. Let me try that again. Do you think I'd need to reinstall the server itself to insure the proper behavior? No, reinstalling the

Re: [GENERAL] Understanding PG9.0 streaming replication feature

2011-01-28 Thread Ray Stell
On Wed, Jan 26, 2011 at 09:02:24PM -0500, Ray Stell wrote: On Wed, Jan 26, 2011 at 02:22:41PM -0800, Dan Birken wrote: Can you give some concrete suggestions on what needs to be added? The current documentation is here: It seems like there is a departure in postgresql/pg_hba.conf with

[GENERAL] Full Text Index Scanning

2011-01-28 Thread Matt Warner
I'm in the process of migrating a project from Oracle to Postgres and have run into a feature question. I know that Postgres has a full-text search feature, but it does not allow scanning the index (as opposed to the data). Specifically, in Oracle you can do select * from table where

Re: [GENERAL] tablespace restore

2011-01-28 Thread shl7c
Vangelis, Did you find a best way to achieve what you were asking about? I have a similar desire to migrate a large table and its indices. Regards, Sky -- View this message in context: http://postgresql.1045698.n5.nabble.com/tablespace-restore-tp3272200p3361935.html Sent from the PostgreSQL -

[GENERAL] Postgresql-8.4.6, 64bit, Solaris 10u9, dtrace

2011-01-28 Thread dennis jenkins
Hello Everyone, My goal is to install a 64-bit build of the latest Postgresql 8.4 (not ready for 9.0 yet) onto a Solaris 10u9 server (Intel chips, X4270), with dtrace support. Postgresql compiles just fine when configured with --disable-dtrace. Attempting to compile when configured with

[GENERAL] Adding more space, and a vacuum question.

2011-01-28 Thread Herouth Maoz
Hello. We have two problems (which may actually be related...) 1. We are running at over 90% capacity of the disk at one of the servers - a report/data warehouse system. We have ran out of disk space several times. Now we need to make some file-archived data available on the database to support

Re: [GENERAL] Full Text Index Scanning

2011-01-28 Thread Oleg Bartunov
Matt, I'd try to use prefix search on original string concatenated with reverse string: Just tried on some spare table knn=# \d spot_toulouse Table public.spot_toulouse Column| Type| Modifiers -+---+---

Re: [GENERAL] error while trying to change the database encoding on a database

2011-01-28 Thread Jasen Betts
On 2011-01-24, Geoffrey Myers li...@serioustechnology.com wrote: Adrian Klaver wrote: Thanks for the suggestion. As it stands, we are getting different errors for different hex characters, thus the solution we need is the ability to identify the characters that won't convert from SQL_ASCII

Re: [GENERAL] Dumpall without OID

2011-01-28 Thread Jasen Betts
On 2011-01-27, Girts Laudaks lauda...@gmail.com wrote: Hi, What could be the possible damage if a database is migraged without the -o (OID) option? Integrity of data? some things that used OID might fail to work. Postgres doesn't need them, does your application? What are the options to

Re: [GENERAL] How to get TimeZone name?

2011-01-28 Thread Jasen Betts
On 2011-01-18, ar...@esri.com ar...@esri.com wrote: Hi, How can I get timezone name? I can get timezone offset but I could not find any reference of timezone name. Change your datestyle setting, a setting of ISO gives nice portable offsets that will work the same anywhere in the world. a

Re: [GENERAL] searching for characters via the hexidecimal value

2011-01-28 Thread Jasen Betts
On 2011-01-24, Geoffrey Myers li...@serioustechnology.com wrote: Massa, Harald Armin wrote: This does not work for me, but if I convert the hex value to octal this does work: select comments from fax where comments ~* E'\231'; you can do hex like this: select comments from fax where

[GENERAL] Re: Separating the ro directory of the DB engine itself from the rw data areas . . .

2011-01-28 Thread Jasen Betts
On 2011-01-24, Albretch Mueller lbrt...@gmail.com wrote: ~ I need to configure postgreSQL in a way that I could run it from a directory mounted as read only, with separate rw partitions mounted for the data, logs, . . . ~ What would be the steps to follow and the issues to take into

[GENERAL] Complex DBs Ontologies

2011-01-28 Thread Alpha Beta
Hello, I tried to translate a small database schema to an ontology model (following some mapping rules). However I guess the process would be more complex to do with a big and more constrained relational database. My question is not specific to Postgresql, But I thought more people in this list

[GENERAL] Re: Separating the ro directory of the DB engine itself from the rw data areas . . .

2011-01-28 Thread Jasen Betts
On 2011-01-24, Albretch Mueller lbrt...@gmail.com wrote: ... better yet; is it possible to configure postgreSQL in a way that it depends on external variables set via the OS in the same process in which it is started? Debian manages that somehow. I've got two 8.4 clusters running and only

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-28 Thread Jasen Betts
On 2011-01-26, Bill Moran wmo...@potentialtech.com wrote: DO NOT use parametrized queries with PHP and bytea (I hate to say that, because parametrized fields are usually a very good idea). PHP has a bug that mangles bytea data when pushed through parametrized fields. PHP bug #35800 OOTOH

Re: [GENERAL] Re: Separating the ro directory of the DB engine itself from the rw data areas . . .

2011-01-28 Thread Andrew Sullivan
On Mon, Jan 24, 2011 at 10:12:28PM +, Albretch Mueller wrote: ... better yet; is it possible to configure postgreSQL in a way that it depends on external variables set via the OS in the same process in which it is started? Sure. Use the -D command-line switch or the $PGDATA environment

[GENERAL] Error trying to install Ruby postgres gems on OS/X

2011-01-28 Thread Mike Christensen
I'm trying to install the Postgres gem on OS/X but getting errors no matter what I try.. In theory, it should be as simple as gem install postgres, correct? Here's what I get: sudo gem install postgres Building native extensions. This could take a while... ERROR: Error installing postgres:

Re: [GENERAL] Error trying to install Ruby postgres gems on OS/X

2011-01-28 Thread Thom Brown
On 29 January 2011 01:37, Mike Christensen m...@kitchenpc.com wrote: I'm trying to install the Postgres gem on OS/X but getting errors no matter what I try..  In theory, it should be as simple as gem install postgres, correct?  Here's what I get: sudo gem install postgres Building native

Re: [GENERAL] resizing a varchar column on 8.3.8

2011-01-28 Thread Jasen Betts
On 2011-01-27, Emi Lu em...@encs.concordia.ca wrote: On 01/15/2011 04:22 PM, Jon Hoffman wrote: Hi, I found a post with some instructions for resizing without locking up the table, but would like to get some re-assurance that this is the best way:

Re: [GENERAL] Error trying to install Ruby postgres gems on OS/X

2011-01-28 Thread Mike Christensen
Now I get: /Library/PostgreSQL/9.0export ARCHFLAGS='-arch i386' /Library/PostgreSQL/9.0sudo -E gem install postgres Password: Building native extensions. This could take a while... ERROR: Error installing postgres: ERROR: Failed to build gem native extension.

Re: [GENERAL] Error trying to install Ruby postgres gems on OS/X

2011-01-28 Thread Mike Christensen
So I installed the postgres-pg library, which if I understand correctly is a Ruby implementation of the adapter (as opposed to native code that has to be built) and that's working fine.. From what I've read, this adapter is much slower but probably fine for non-production use (I'm just learning

Re: [GENERAL] Error trying to install Ruby postgres gems on OS/X

2011-01-28 Thread Thom Brown
On 29 January 2011 01:50, Mike Christensen m...@kitchenpc.com wrote: Now I get: /Library/PostgreSQL/9.0export ARCHFLAGS='-arch i386' /Library/PostgreSQL/9.0sudo -E gem install postgres Password: Building native extensions.  This could take a while... ERROR:  Error installing postgres:      

Re: [GENERAL] Store base64 in database. Use bytea or text?

2011-01-28 Thread Jasen Betts
On 2011-01-28, Dmitriy Igrishin dmit...@gmail.com wrote: --001636c598d9470a92049ae97be4 Content-Type: text/plain; charset=UTF-8 2011/1/28 Andre Lopes lopes80an...@gmail.com Hi, Another question about this subject. It is possible to cache this images from the database? In the future I

Re: [GENERAL] Error trying to install Ruby postgres gems on OS/X

2011-01-28 Thread Mike Christensen
You might have to tell it where the PostgreSQL binaries live first then: export PATH=$PATH:/Library/PostgreSQL/9.0/bin Hey that seems to have fixed it! Thanks! Mike -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] One last Ruby question for tonight - Regarding UUID type

2011-01-28 Thread Mike Christensen
My goal is to learn Ruby by porting one of my existing PG web applications over to Rails.. However, my existing data heavily relies on the UUID data type. I've noticed when I create a new model with something like: guidtest name:string value:uuid And then do a rake:migrate, the CREATE TABLE

Re: [GENERAL] One last Ruby question for tonight - Regarding UUID type

2011-01-28 Thread Mike Christensen
My goal is to learn Ruby by porting one of my existing PG web applications over to Rails..  However, my existing data heavily relies on the UUID data type.  I've noticed when I create a new model with something like: guidtest name:string value:uuid And then do a rake:migrate, the CREATE