On Mon, 17 Dec 2018 at 02:28, Thomas Kellerer wrote:
> Rob Sargent schrieb am 14.12.2018 um 19:28:
> > Using java 1.8, postgresql-42.1.4.jar, embedded tomcat 9
> >
> > It appears to me that I need to make the call
> > "Class.forName("org.postgresql.Driver)" when the entry is in a
> > servlet. Is
Hi,
is there a way to stop execution of a psql script if a select returns some rows
(or no rows)
The idea is to add a safety check on data, specifically to select all new rows
that would conflict
on a bulk insert, show them and stop
Best regards
Wolfgang
Hello Good People of the Forum!
I am trying to insert some data into a PostgreSQL database using PHP and
struggling to create an array so that pg_copy_from function will accept and
process the data.
I can insert data but not the way I want- my data this case contains comma,
space, double quotes
Hi
po 17. 12. 2018 v 13:14 odesílatel napsal:
>
>
> Hi,
>
> is there a way to stop execution of a psql script if a select returns some
> rows (or no rows)
> The idea is to add a safety check on data, specifically to select all new
> rows that would conflict
> on a bulk insert, show them and stop
Hi
is there a way to stop execution of a psql script if a select returns some rows
(or no rows)
The idea is to add a safety check on data, specifically to select all new rows
that would conflict
on a bulk insert, show them and stop
Look at \if command in psql (since v10):
select count(*) as
Hi,
many thanks -- too bad I am still using 9.3
Best regards
Wolfgang
>> Hi
>> >> po 17. 12. 2018 v 13:14 odesílatel napsal:
>> >> >
>> >
>> > Hi,
>> >
>> > is there a way to stop execution of a psql script if a select returns some
>> > rows (or no rows)
>> > The idea is to add a safety check o
On 17.12.2018 16:07, haman...@t-online.de wrote:
Hi, many thanks -- too bad I am still using 9.3
In this case you can try ON_ERROR_STOP psql variable.
Something like this:
\set ON_ERROR_STOP on
do $$
declare
total bigint;
begin
select count(*) into total from pg_class where 1=1;
Hi,
many thanks, I will give it a try tomorrow
Best regards
Wolfgang
>> >> On 17.12.2018 16:07, haman...@t-online.de wrote:
>> > Hi, many thanks -- too bad I am still using 9.3
>> >> In this case you can try ON_ERROR_STOP psql variable.
>> Something like this:
>> >> \set ON_ERROR_STOP on
>> >> d
Thanks a lot Tom, as always :)
We generally do not have so many duplicates in production, so maybe this is
an edge case but I am happy with the explanation and the code reference for
the analysis.
I’ll also play with default statistic target to see what changes by
increasing the value.
On Sun, 16
Hello,
On Mon, 2018-12-17 at 21:34 +0900, s4...@yahoo.co.jp wrote:
> Hello Good People of the Forum!
>
> I am trying to insert some data into a PostgreSQL database using PHP
> and struggling to create an array so that pg_copy_from function will
> accept and process the data.
>
> I can insert dat
Il 12/12/2018 16:01, Tom Lane ha scritto:
The safest way to clean it up manually would be to set the pg_proc.proacl
field for that function to NULL. If there are other grants about the
function, you could try removing the bad entry, but it would likely be
safer to just re-grant after the upgrad
wrote:
> When I save that Excel as a tab delimited text file, I get this:rec_no
> item1item2item3item4item5
> 1Denny'sorange juice"1,500 yen""""Dear John""""32""
> TV"(As seen when I opened that file with Notepad)
This looks good. Fields are prope
We are using Postgers-XL based on PostgreSQL 10.5 on RHEL7. We have an extreme
case of one query which running in 4 hour 45 mins and 33 seconds with Nested
Loops Join vs 2.5 seconds when we disable enable_nestloop. The query is given
below. I would be happy to share more information if required.
haman...@t-online.de writes:
> Hi,
>
> many thanks -- too bad I am still using 9.3
Just because your server backend is 9.3 does not rule out using much
newer clients, such as psql.
HTH
>
> Best regards
> Wolfgang
>
>>> Hi
>>> >> po 17. 12. 2018 v 13:14 odesílatel napsal:
>>> >> >
>>> >
>>> > H
On 12/17/2018 09:01 AM, Jerry Sievers wrote:
haman...@t-online.de writes:
Hi,
many thanks -- too bad I am still using 9.3
Just because your server backend is 9.3 does not rule out using much
newer clients, such as psql.
While technically true, and is useful, many production servers (especia
"Kumar, Virendra" writes:
> We are using Postgers-XL based on PostgreSQL 10.5 on RHEL7. We have an
> extreme case of one query which running in 4 hour 45 mins and 33 seconds with
> Nested Loops Join vs 2.5 seconds when we disable enable_nestloop. The query
> is given below. I would be happy to
Hi Daniel,
Thank you for the comments.
I changed my line 7 to this:
$line = implode("\t",$line). "\n";
Now, I get the following.
Warning: pg_copy_from(): Copy command failed: ERROR: extra data after last
expected column CONTEXT: COPY test_table, line 1: "1 Denny's orange juice
"1
I want to alter a term in a column's constraint to allow only specified
strings as attributes and have not found how to do this in the docs (using
version 10 docs now). There is an alter table command that allows renaming a
constraint but I've not seen how to modify the constraint itself.
Poi
On Mon, 17 Dec 2018, Rich Shepard wrote:
I want to alter a term in a column's constraint to allow only specified
strings as attributes and have not found how to do this in the docs (using
version 10 docs now). There is an alter table command that allows renaming
a constraint but I've not seen ho
On 12/17/18 12:01 PM, Rich Shepard wrote:
On Mon, 17 Dec 2018, Rich Shepard wrote:
I want to alter a term in a column's constraint to allow only specified
strings as attributes and have not found how to do this in the docs
(using
version 10 docs now). There is an alter table command that allow
>I want to alter a term in a column's constraint to allow only specified
> strings as attributes
Yes, you must drop then add the revised constraint. However, from your
statement above, it sounds to
me as if you would be better off using A FOREIGN kEY CONSTRAINT. It makes
things a lot simpler.
On M
On Mon, 17 Dec 2018, Melvin Davidson wrote:
Yes, you must drop then add the revised constraint. However, from your
statement above, it sounds to me as if you would be better off using A
FOREIGN kEY CONSTRAINT. It makes things a lot simpler.
Melvin,
I don't follow. Here's the DDL for that co
Thank you Tom for initial thoughts!
I tried query with function dependency statistics but it did not help. I don't
see we can create such statistics on table join.
Regards,
Virendra
-Original Message-
From: Tom Lane [mailto:t...@sss.pgh.pa.us]
Sent: Monday, December 17, 2018 12:02 PM
T
On 12/17/2018 02:20 PM, Rich Shepard wrote:
On Mon, 17 Dec 2018, Melvin Davidson wrote:
Yes, you must drop then add the revised constraint. However, from your
statement above, it sounds to me as if you would be better off using A
FOREIGN kEY CONSTRAINT. It makes things a lot simpler.
Melvin,
On Mon, Dec 17, 2018 at 1:20 PM Rich Shepard wrote:
>
> On Mon, 17 Dec 2018, Melvin Davidson wrote:
>
> > Yes, you must drop then add the revised constraint. However, from your
> > statement above, it sounds to me as if you would be better off using A
> > FOREIGN kEY CONSTRAINT. It makes things a
So CREATE a table eg:
CREATE TABLE fks_for_tables
( fks_id serial
fks_values varchar(20),
CONSTRAINT fks_pkey PRIMARY KEY (fks_id),
CONSTRAINT fks-unique UNIQUE fks_values
)
Then
INSERT INTO fks_for_tables
(fks_values)
VALUES
( 'Agriculture'),
('Business'),
('other))',
'Chemicals')
...
...
('T
See https://www.postgresql.org/docs/current/tutorial-fk.html
On Mon, Dec 17, 2018 at 3:32 PM David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Mon, Dec 17, 2018 at 1:20 PM Rich Shepard
> wrote:
> >
> > On Mon, 17 Dec 2018, Melvin Davidson wrote:
> >
> > > Yes, you must drop then add th
On 12/17/18 12:20 PM, Rich Shepard wrote:
On Mon, 17 Dec 2018, Melvin Davidson wrote:
Yes, you must drop then add the revised constraint. However, from your
statement above, it sounds to me as if you would be better off using A
FOREIGN kEY CONSTRAINT. It makes things a lot simpler.
Melvin,
On Tue, 18 Dec 2018 at 09:21, Kumar, Virendra
wrote:
> I tried query with function dependency statistics but it did not help. I
> don't see we can create such statistics on table join.
There's mention of why this is the case in the docs in [1]:
"14.2.2.1.1. Limitations of Functional Dependencie
On Mon, 17 Dec 2018, Ron wrote:
Melvin is saying to:
1. create a table named valid_industry,
2. populate it with the valid industries,
3. create an FK constraint on your main table's industry column to
valid_industry.industry, and then
4. drop the constraint invalid_industry.
Got it. Hadn'
May I ask the proper (fast) way of inserting bulk data and if possible, an
example would be very appreciated.
Please note that the data I would like to insert contains arrays (float8[]).
By the way, my environment is Windows 10, PostgreSQL 11 and compiling with
Visual Studio 2017.
In my application, the idle sessions are consuming cpu and ram. refer the
ps command output.
How idle session will consume more ram/cpu?
How to control it?
We are using Postgresql 9.2 with Centos 6 os. Please guide me.
[image: image.png]
--
Regards,
Raghavendra Rao J S V
Mobile- 8861161425
Hello Daniel!
This afternoon, I tried it again, and yes, your suggestion that I use a tab
delimited symbol ("\t") instead of a space for the implode works flawlessly.
Yesterday, I reported I got "Warning: pg_copy_from(): Copy command failed:
ERROR: extra data after last expected..".
That was be
>and now I can see my data saved in the database without those extra double
>quotes.
.. and with my comma intact as well.
- Original Message -
> From: "s4...@yahoo.co.jp"
> To: Daniel Verite
> Cc: "pgsql-general@lists.postgresql.org"
> Date: 2018/12/18, Tue 14:15
> Subject: Re: Crea
Hello Rob,
Thank you for your comments.
As I wrote just a few minutes ago, using a tab delimiter inside the implode as
suggested by Daniel (and specifying the read length ("0") for the fgetcsv has
solved this problem.
At one point, I had tried to use the last parameter - enclosure character - i
Hi, ALL,
I have a following statement:
IF NOT EXIST( SELECT 1 SELECT 1 FROM pg_proc AS proc, pg_namespace AS
ns ) CREATE FUNCTION();
Unfortunately trying to execute it thru the ODBC interface with:
ret = SQLExecDirect( m_hstmt, query, SQL_NTS );
gives syntax error near IF.
What is the proper w
Hi
út 18. 12. 2018 v 7:11 odesílatel Igor Korot napsal:
> Hi, ALL,
> I have a following statement:
>
> IF NOT EXIST( SELECT 1 SELECT 1 FROM pg_proc AS proc, pg_namespace AS
> ns ) CREATE FUNCTION();
>
> Unfortunately trying to execute it thru the ODBC interface with:
>
> ret = SQLExecDirect( m_h
My statement below updates the pricing no problem, but I want it to be
formatted with 2 dec points eg (43.23).
Started playing with to_numeric but can't figure it out. Lots of
examples with to_char in the
manual, but still searching for answer.
Can it be done?
I want suggested_retail_price to be
út 18. 12. 2018 v 8:15 odesílatel Bret Stern <
bret_st...@machinemanagement.com> napsal:
> My statement below updates the pricing no problem, but I want it to be
> formatted with 2 dec points eg (43.23).
>
> Started playing with to_numeric but can't figure it out. Lots of examples
> with to_char i
39 matches
Mail list logo