How to create string concatenation operator which preserves trailing spaces
on CHAR(n) type columns ?
I tried code below, but it returns AB (without spaces).
How to force it to return A B (keep space after A) ?
Andrus.
CREATE OR REPLACE FUNCTION public.stringconcat(left text, right text)
Andrus wrote:
How to create string concatenation operator which preserves trailing spaces
on CHAR(n) type columns ?
I tried code below, but it returns AB (without spaces).
How to force it to return A B (keep space after A) ?
Andrus.
CREATE OR REPLACE FUNCTION public.stringconcat(left
Hi!
Use bpchar instead of text in the definition of function and operator.
Otherwise col1 gets cast to text and loses its trailing spaces.
Thank you very much.
It worked.
Which notation to use for this ?
Is it reasonable use + as such operator for strings or should some other
notation used
Andrus wrote:
Use bpchar instead of text in the definition of function and operator.
Otherwise col1 gets cast to text and loses its trailing spaces.
Thank you very much.
It worked.
Which notation to use for this ?
Is it reasonable use + as such operator for strings or should some other
On 07/28/2014 09:33 PM, Tobias Fielitz wrote:
Hi,
I am trying to start pgbouncer via upstart script. The upstart logs
(/var/log/upstart/pgbouncer.log) tell me:
/var/run/postgresql/pgbouncer.pid: No such file or directory [2]
but when starting pgbouncer from the console with:
sudo service
Hello!
Is it possible to detect what master transaction is visible on standby?
I try to use txid_current_snapshot() but it return wrong result on standby:
_master_:
create table tmp.txid_test(txid bigint, ss txid_snapshot)
begin;
insert into tmp.txid_test values (txid_current(),
A couple months ago we upgraded the RAM on our database servers from 48GB
to 64GB. Immediately afterwards the new RAM was being used for page cache,
which is what we want, but that seems to have dropped off over time, and
there's currently actually like 12GB of totally unused RAM.
Greetings,
I want to call a function using a column of a table as the parameter and
return the parameter and function results together.
The problem is, when the function returns an empty row my select statement
that uses the function returns an empty row as well.
The following simplified snippet
Hello
you can try
world=# CREATE OR REPLACE FUNCTION xx(int)
world-# RETURNS TABLE(a int, b int) AS
world-# $$ SELECT $1, $1 WHERE $1 = 1 UNION ALL SELECT NULL, NULL LIMIT 1;
$$
world-# LANGUAGE sql;
CREATE FUNCTION
Time: 74.320 ms
world=# SELECT * FROM xx(1);
a | b
---+---
1 | 1
(1 row)
Seref Arikan wrote
select 1,test_empty_row(1);
SELECT 1, (SELECT test_empty_row(1)) AS func_result
You can also adjust the function to either return the result of the query OR
RETURN NULL if no results were found. i.e., do not use RETURN QUERY
David J.
--
View this message in context:
On Wed, Jul 30, 2014 at 12:51 PM, Kevin Goess kgo...@bepress.com wrote:
A couple months ago we upgraded the RAM on our database servers from 48GB to
64GB. Immediately afterwards the new RAM was being used for page cache,
which is what we want, but that seems to have dropped off over time, and
Seref Arikan serefari...@gmail.com writes:
I want to call a function using a column of a table as the parameter and
return the parameter and function results together.
The problem is, when the function returns an empty row my select statement
that uses the function returns an empty row as
Good suggestion, but nope, that ain't it:
$ cat /proc/sys/vm/zone_reclaim_mode
0
On Wed, Jul 30, 2014 at 11:49 AM, Merlin Moncure mmonc...@gmail.com wrote:
On Wed, Jul 30, 2014 at 12:51 PM, Kevin Goess kgo...@bepress.com wrote:
A couple months ago we upgraded the RAM on our database
Pavel, thank you so much. This did the trick!
On Wed, Jul 30, 2014 at 7:18 PM, Pavel Stehule pavel.steh...@gmail.com
wrote:
Hello
you can try
world=# CREATE OR REPLACE FUNCTION xx(int)
world-# RETURNS TABLE(a int, b int) AS
world-# $$ SELECT $1, $1 WHERE $1 = 1 UNION ALL SELECT NULL,
On Wed, Jul 30, 2014 at 12:57 PM, Kevin Goess kgo...@bepress.com wrote:
On Wed, Jul 30, 2014 at 11:49 AM, Merlin Moncure mmonc...@gmail.com wrote:
On Wed, Jul 30, 2014 at 12:51 PM, Kevin Goess kgo...@bepress.com wrote:
A couple months ago we upgraded the RAM on our database servers from
48GB
Hi David,
Thanks for the feedback. I've actually tried to do what you've suggested,
but I always found myself unable to do the check for empty result for query
in an elegant way.
That is, I end up thinking about creating a temp table to put the query
results in (which can be 1), then check if the
Merlin Moncure mmonc...@gmail.com wrote:
On Wed, Jul 30, 2014 at 12:51 PM, Kevin Goess kgo...@bepress.com wrote:
A couple months ago we upgraded the RAM on our database servers from 48GB to
64GB. Immediately afterwards the new RAM was being used for page cache,
which is what we want, but
Thanks Tom,
The function can return multiple rows. It is a very simplified version of a
function that is used in the context of an EAV design.
It should return 0 or more rows that match the criteria that is calculated
in the function.
Originally I had a left outer join from the table that I'm
On Wed, Jul 30, 2014 at 1:05 PM, Kevin Grittner kgri...@ymail.com wrote:
Merlin Moncure mmonc...@gmail.com wrote:
On Wed, Jul 30, 2014 at 12:51 PM, Kevin Goess kgo...@bepress.com wrote:
A couple months ago we upgraded the RAM on our database servers from 48GB to
64GB. Immediately afterwards
Hello all,
I've got two queries which should produce the same results but they don't
for some reason, please consider these :
SELECT date_trunc('day', payments.created_at) day,
SUM(payments.amount) AS sum_id FROM payments
INNER JOIN users ON users.id = payments.user_id WHERE
payments.currency
Emir Ibrahimbegovic wrote
Hello all,
I've got two queries which should produce the same results but they don't
for some reason, please consider these :
SELECT date_trunc('day', payments.created_at) day,
SUM(payments.amount) AS sum_id FROM payments
INNER JOIN users ON users.id =
On Wed, Jul 30, 2014 at 8:41 PM, Emir Ibrahimbegovic
emir.ibrahimbego...@gmail.com wrote:
Hello all,
I've got two queries which should produce the same results but they don't
for some reason, please consider these :
SELECT date_trunc('day', payments.created_at) day, SUM(payments.amount)
We are trying to help a client, one of their databases was being backed
up via snapshots without running a pg_start_backup or pg_stop _backup
Recently they had an issue and they recovered from one of these snapshot
backups, which are now producing errors such as :
Invalid page header in block
Hi everyone I read that 2ndQuadrant released bidirectional replication
for postgres,
know whether this package will enter apt.postgresql.org or if there will
be any repository
for Debian GNU / Linux?
thanks
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make
(Cross-posted to StackOverflow:
http://stackoverflow.com/questions/25041100/postgresql-user-defined-operator-function-what-parameter-type-to-use-for-uncast
)
I'm defining my own domain and a equality operator. I cannot cause
PostgreSQL to use my operator function in a query without explicitly
25 matches
Mail list logo