[GENERAL] Re: Add COPY statement inside sql function AND/OR call function within function

2013-11-15 Thread David Johnston
Johannes Björk wrote > Hi, Im hoping someone could help me with this. I am new to any kind of sql > coding so bare with me. > > I have written the below working function which I would like to print to > .csv file(s) > > CREATE FUNCTION retrieve_info(input_method TEXT, input_species TEXT) > RETURN

[GENERAL] log_line_prefix

2013-11-15 Thread Jayadevan M
Hi, I was trying different options of log_line_prefix. I am making chnages, doing a pg_ctl reload and checking the output in the log files. For some reason ,the changes seem to have no impact. What am I doing wrong? Here is the output form the log files where you can see the change being accepted (

Re: [GENERAL] Add COPY statement inside sql function AND/OR call function within function

2013-11-15 Thread Adrian Klaver
On 11/12/2013 12:56 PM, Johannes Björk wrote: Hi, Im hoping someone could help me with this. I am new to any kind of sql coding so bare with me. I have written the below working function which I would like to print to .csv file(s) |CREATE FUNCTION retrieve_info(input_method TEXT, input_speci

[GENERAL] Postgresql Service and Server synch up issue.

2013-11-15 Thread Yelai, Ramkumar IN BLR STS
Hi All, We are using postgreql 9.2 as a main backend server for our project. We have been using this server since last year. We have configured postgresql as a windows service. Till last week, we have not faced any issues to start server from service console management, but last week we hav

[GENERAL] Save many data chunks to file

2013-11-15 Thread whiplash
Hello! I have a table with image data: /CREATE TABLE images// //(// //id serial,// //image_data bytea,// //...// //);/ This is function for store image data to file: /CREATE OR REPLACE FUNCTION write_bytea ( p_data bytea, p_filename text )// //RETURNS void AS// //$BODY$// //DECLARE/

Re: [GENERAL] Partitioned table question

2013-11-15 Thread Gabriel Sánchez-Martínez
On 11/13/2013 06:22 AM, Torsten Förtsch wrote: Hi, we have a table partitioned by time. Each month goes into a separate child table. Primary key in each table is (underlying, ts). The resulting index is perfect for ordering like in the query below. Each child table has a constraint like: CH

[GENERAL] PGSQL: listing db/role and user/role relationships

2013-11-15 Thread Felipe Gasper
Hi all, How can I retrieve: 1) each role’s privileges on a given DB For example, if I do: “GRANT ALL PRIVILEGES ON DATABASE thedb TO therole”, how can I list this grant among others with access to “thedb”? 2) which users have access to a given role For example, if I do: “GRANT the

Re: [GENERAL] Push predicate down in view containing window function

2013-11-15 Thread Merlin Moncure
On Fri, Nov 15, 2013 at 12:43 AM, Philippe Girolami wrote: > Ok so is there a way i can do something similar ? Would a function returning > rows and taking the extra predicate 'values' as parameters be as optimized as > the 'good' query in my first email ? There is only one way I know of to do

Re: [GENERAL] Composite types or composite keys?

2013-11-15 Thread Merlin Moncure
On Fri, Nov 15, 2013 at 2:01 AM, Tony Theodore wrote: > Hi, > > I was reading about composite types and wondering if I should use them > instead of composite keys. I currently have tables like this: > > create table products ( > source_system text, > product_id text, > des

Re: [GENERAL] Install pg_trgm from source

2013-11-15 Thread Janek Sendrowski
Thanks a lot for your Answers.   That's what I was looking for. I couln't find it. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Install pg_trgm from source

2013-11-15 Thread Michael Paquier
On Fri, Nov 15, 2013 at 10:00 PM, Janek Sendrowski wrote: > Hi, > > I like to change the source code of the pg_trgm extension a little bit. > Where can I get the source code and how do I compile it? If you have fetched a tarball of Postgres or git copy, simply have a look in contrib/pg_trgm. Regar

Re: [GENERAL] Install pg_trgm from source

2013-11-15 Thread Devrim GÜNDÜZ
Hi, On Fri, 2013-11-15 at 14:00 +0100, Janek Sendrowski wrote: > > I like to change the source code of the pg_trgm extension a little > bit. Where can I get the source code and how do I compile it? Here is the code in git master: http://git.postgresql.org/gitweb/?p=postgresql.git;a=tree;f=con

Re: [GENERAL] counterpart to LOAD

2013-11-15 Thread Albe Laurenz
Andreas Kretschmer wrote: > ist there (in 9.1) a way to unload a shared lib? > > It seems it's impossible since 8.1 or so, i'm right? Yes: http://www.postgresql.org/docs/9.3/static/xfunc-c.html#XFUNC-C-DYNLOAD "(Presently, unloads are disabled and will never occur, but this may change in the fu

[GENERAL] Install pg_trgm from source

2013-11-15 Thread Janek Sendrowski
Hi,   I like to change the source code of the pg_trgm extension a little bit. Where can I get the source code and how do I compile it?   I can only find the SQL-files of pg_trgm in my directories.   Janek Sendowksi

[GENERAL] counterpart to LOAD

2013-11-15 Thread Andreas Kretschmer
Hi @all, ist there (in 9.1) a way to unload a shared lib? It seems it's impossible since 8.1 or so, i'm right? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Postgres Server backend process

2013-11-15 Thread Albe Laurenz
Jayadevan M wrote: > The code has these comments - > "When a request message is received, we now fork() immediately. The child > process performs > authentication of the request," > > Now authentication is done by the Backend process and not by the daemon? Yes. The authentication is called in I

Re: [GENERAL] pg_trgm module: no convertion into Trigrams on one side when comparing

2013-11-15 Thread Janek Sendrowski
Hi Amit, Do you think it would by difficult to edit the source and wirte a new function, wich does it?   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Postgres Server backend process

2013-11-15 Thread Jayadevan M
Hello, I was going through http://www.postgresql.org/files/developer/tour.pdf and the source at http://doxygen.postgresql.org/postmaster_8c_source.html The pdf shows the daemon process doing authentication and spawning a process to handle the request from the client. The code has these comments -

[GENERAL] Composite types or composite keys?

2013-11-15 Thread Tony Theodore
Hi, I was reading about composite types and wondering if I should use them instead of composite keys. I currently have tables like this: create table products ( source_system text, product_id text, description text, ... primary key (source_system, product_