Re: How to avoid trailing zero (after decimal point) for numeric type column

2018-03-01 Thread Francisco Olarte
perl -w -e 'printf q(%1$f %1$.20f %1$a %1$.20a)."\n", 0.1' 0.10 0.1555 0x1.ap-4 0x1.a000p-4 See the trailing 555 in the second? or the continous 1.(9) fraction rounded to a in excess on the least significant place in hex? In numeric you can hace 1.0, 1.0, 1.1 and 0.99, but in doubles they all map to 1.0 Francisco Olarte.

Re: Enforce primary key on every table during dev?

2018-03-01 Thread Francisco Olarte
Melvin: On Thu, Mar 1, 2018 at 1:47 AM, Melvin Davidson wrote: > But this begs the question, > why are "developers" allowed to design database tables? That should be the > job of the DBA! That's the DBA wearing her developer hat. ( I agree with the spirit ) Francisco Olarte.

Re: Enforce primary key on every table during dev?

2018-03-01 Thread Francisco Olarte
s with an opposite > transaction. And normally you would need to pinpoint an individual transaction for selection, hard to do if you do not have a pk. Francisco Olarte.

Re: Enforce primary key on every table during dev?

2018-03-01 Thread Francisco Olarte
conds after deployment the PHB will decide you can do cross-currency sales. Francisco Olarte.

Re: Enforce primary key on every table during dev?

2018-03-01 Thread Francisco Olarte
atabase). Good point. All the times I've found myself with complete duplicates allowed I've alwasy found the correct model is no duplicates + count field ( with possible splits as you pointed below ). I would not have a "marbles" table with (red, red, blue, white, red, white), I would switch it to red=3, blue=1, white=2. Francisco Olarte.

Re: Command to execute SQL string

2018-03-08 Thread Francisco Olarte
ained in each row. Anyway, it is easy with a procedure, look for example at https://www.postgresql.org/docs/10/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN just do a loop on your command table, follow the examples and you should be done. Francisco Olarte. PS: > Jacek I

Re: Trigger to create string to inverse SQL statement

2018-03-08 Thread Francisco Olarte
unction which does it for you, you'll have to code something, and I suspect it may be easier to just capture op, old and new in your triggers and use an external program to build the inverted queries. ​Francisco Olarte.​

Re: Trigger to create string to inverse SQL statement

2018-03-08 Thread Francisco Olarte
y better ( is like backups, you normally make backups faster, then optimize what you can of restores, as ideally they would never be used, or transactions, you normally optimize for commits first, then rollbacks ). Francisco Olarte.

Re: Trigger to create string to inverse SQL statement

2018-03-08 Thread Francisco Olarte
Jacek: On Thu, Mar 8, 2018 at 1:53 PM, Łukasz Jarych wrote: > maybe somebody wrote SP to invert update statement? Maybe, but if you are going to ask for it you better define the problem a little. Francisco Olarte.

Re: Doubts about replication..

2018-04-20 Thread Francisco Olarte
ard from the last full backup to just before the delete. Francisco Olarte.

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Francisco Olarte
ession configured time zone, in the without case it treats it ( aproximately ) as if it was in utc ( and then discards the "+00" after formating ). Maybe I'm confussing you more, its not too easy to explain. The point is TIMEZONE is not stored in either of them. Francisco Olarte.

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Francisco Olarte
On Thu, May 10, 2018 at 12:19 PM, Ben Hood wrote: >> On 10 May 2018, at 09:59, Francisco Olarte wrote: >> Maybe I'm confussing you more, its not too easy to explain. >> The point is TIMEZONE is not stored in either of them. > > Many thanks for clarification, ve

Re: Enhancement to psql command, feedback.

2018-05-10 Thread Francisco Olarte
ere Good bye then folarte:~/tmp$ perl -e 'exec("./xx")' #!/bin/cat Hello there Good bye then You can try other ways to call execv*, nothing magical in the perl way, just avoiding the shell ( which has an exec builtin command, with different behaviour from typing a command name, which does fork, wait in the parent, execv in the child ). Francisco Olarte.

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-12 Thread Francisco Olarte
On Thu, May 10, 2018 at 10:37 PM, Ben Hood wrote: > On 10 May 2018, at 16:33, Francisco Olarte wrote: > > For what you want to do I think you'll have to parse the text value, > maybe by definig a view with a text columns and using some > rule/trigger magic for insert / upda

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-12 Thread Francisco Olarte
Adrian: On Sat, May 12, 2018 at 6:42 PM, Adrian Klaver wrote: > On 05/12/2018 04:04 AM, Francisco Olarte wrote: ... >> Can you post an example ( correct, error inputs, preferrably done with >> psql ) ? >> >> At this point I do not know if it is working or if it see

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-13 Thread Francisco Olarte
with a timestamp with timezone that you cannot do with a int8 number or a with a timestamp without time zone. Given there is an isomorphism between them ( and, in postgres, the text version is the same for the inverse, IIRC "one=the_other at timezone UTC" ) and they have the same representation, I doubt it. They are just convenient ways to manipulate text values and apply functions based on type, but they do not have a time zone. You can not get a time zone from a timestamp with time zone value. What leads to countless confussion is it seems that a tstz-value should be composed of a ts-value plus a tz-value, but they are not. Is just a problem with naming. Francisco Olarte.

Re: case statement within insert

2018-05-25 Thread Francisco Olarte
rstand, but CASE WHEN condition THEN true ELSE false END when contition is ( as it should in a CASE ) a boolean expression is a classic antipattern , just use 'condition' or '(condition)' Francisco Olarte.

Re: Doing a \set through perl DBI ?

2018-06-07 Thread Francisco Olarte
r_id_column=$<") ( Of course, you could "use English;" to get $UID, or use placeholders to avoid injections, that's just an initial pointer ) ( or "perldoc perlvar" if you do not know what $< is, and that is enough perl stuff for a postres list ) Francisco Olarte

Re: Print pg_lsn as a number?

2018-06-12 Thread Francisco Olarte
27;68/1225BB70') - pg_lsn('0/0'))::bigint) ; ( http://sqlfiddle.com/#!17/9eecb/16272 ) Reconstructing via simple addition does not work, but you can do division, modulus, double to_hex, join with '/', cast to pg_lsn if you like. Francisco Olarte.

Re: Is there a way to be notified on the CREATE TABLE execution?

2018-06-20 Thread Francisco Olarte
he event and notifying selectively. You can use a channel per event. Francisco Olarte.

Re: Is there a way to be notified on the CREATE TABLE execution?

2018-06-20 Thread Francisco Olarte
need C extension functions anyway, unless your usage pattern is truly bizarre a triger for ddl could be written in any pl. Francisco Olarte.

Re: Is there a way to be notified on the CREATE TABLE execution?

2018-06-20 Thread Francisco Olarte
me listen fires, it seems the difficult work is done but it misses the notify to signal listeners and avoid having to rescan on a timer or a similar thing ). ( Maybe I missed the line, it would not be the first time, that's why I ask ). Francisco Olarte.

Re: Convert Existing Table to a Partition Table in PG10

2018-07-01 Thread Francisco Olarte
e things ( like dates, which are countable ) it does not matter that much, I use half-open for easier upgrading if I need to, but you can translate open-closed-half. Francisco Olarte.

Re: Split daterange into sub periods

2018-07-05 Thread Francisco Olarte
ot;, and also some conditions ( i.e., can the small periods interesect? are they completely covered by the big one? can they include the endpoints of the big one? Can they be empty? Does the result need to be minimal ( in the number of result periods ) ? ). Even then, this is not trivial and, as said above, you will probably need a function for it. Francisco Olarte.

Re: Code of Conduct

2018-09-19 Thread Francisco Olarte
ponse to it a violation of the current CoC ? Francisco Olarte.

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-28 Thread Francisco Olarte
advice previously, and like those I only know ways to do it daily/weekly/monthly/yearly. Francisco Olarte.

Re: pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread Francisco Olarte
more stuff, I think the function will also need read-commited or something similar to see the data appear, and fail under serializable. Pattern certainly smells funny. I do some similar things, but I sleep outside of the database, is there a reason this can not be done? Francisco Olarte.

Re: pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread Francisco Olarte
n a loop ), and a wrapping one testing for the "data appears" condition and calling the first, and call the second in a loop. But again, details will be needed and trusting your words I do not want them on the list ;-> . Francisco Olarte.

Re: Why the index is not used ?

2018-10-07 Thread Francisco Olarte
D copy in the index. So, getting it from the server is trivial for anyone with filesystem access. Francisco Olarte.

Re: Filtering before join with date_trunc()

2018-10-15 Thread Francisco Olarte
FULL JOIN temperatures USING ("time") ORDER BY 1; -- ORDER BY GOES HERE, I suspect your example got ordered by chance, not by dessign. ( use other names, I just used the view names for C&P, lazy me ). Francisco Olarte.

Re: compressing network packets

2019-08-01 Thread Francisco Olarte
o compress network traffic between a pg windows client and a windows server on another machine" and some windows savvy reader may be able to help you ( I can think of a couple solutions for that on my basic desktop OS with the basic tools, I'm sure something like windows must have dozens ). Francisco Olarte.

Re: Having the issue in while selecting the data and feltering in order by.

2019-08-08 Thread Francisco Olarte
LL=en_US.UTF-8 sort a A b B1 $ echo -e 'a\nA\nb\nB1' | LC_ALL=C.UTF-8 sort A B1 a b Because it may matter for you, and I doubt the interactions can be properly tested without a proper dataset AND a windos pg server. Francisco Olarte.

Re: Having the issue in while selecting the data and feltering in order by.

2019-08-08 Thread Francisco Olarte
s not ignore _ as the windows one does is easy, but replicating all the doodahs may be difficult without knowing how the windows locale sorts all the chars ( and I'm not getting at 1a vs a1, or _ vs a vs A). I suspect C locale may be ok though. Francisco Olarte.

Re: constrain with MATCH full and NULL values in referenced table

2019-08-12 Thread Francisco Olarte
to reject an entry if b is null, because I dessigned it that way, but DOES REJECT if a is null and B is not. Regards. Francisco Olarte.

Re: SELECT all the rows where id is children of other node.

2019-08-21 Thread Francisco Olarte
e a little care when mutating them, you can do it traversing by id, but you need a full scan, a recursive query with several index scans may easily be faster in wide trees. Francisco Olarte.

Re: SQL equivalint of #incude directive ?

2019-08-31 Thread Francisco Olarte
and even doing "cat *.sql | psql" and naming the scripts appropiately. You'll probably have it easier going by that route ( generating the sql script from chunks using a tool of your choice, it's just a big text chunk and you can easily debug it with a text editor ), and it is not that complex. Francisco Olarte.

Re: SQL equivalint of #incude directive ?

2019-09-01 Thread Francisco Olarte
aux files + source some echoing files and, if quotes are used for something like column names, cat + here docs. Francisco Olarte.

Re: How to reformat output of "age()" function

2019-09-11 Thread Francisco Olarte
9.11.20 20:00:00'::timestamptz) - extract(epoch from '2019.06.10 10:00:00'::timestamptz) as elapsed_seconds; elapsed_seconds - 14122800 (1 row) Francisco Olarte.

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
OOps, I got it bad: On Thu, Sep 12, 2019 at 1:50 PM Francisco Olarte wrote: > timestamp / interval arithmetic is really a hairy thing. ( As shown > below, start point carefully taken to avoid crossing dsts ) It was chosen to FORCE, not AVOID, crossing dst. > cdrs=# select x, '20

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
Adrian: On Wed, Sep 11, 2019 at 11:19 PM Adrian Klaver wrote: > On 9/11/19 9:34 AM, Francisco Olarte wrote: ... > > If you want to know the elapsed minutes between two timestamps, it > > might be better to do it directly, extract the epoch from both ( > > seconds ), su

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
alls to extract ring / talk time from setup/connect/disconnect time, and I do not hit problems because I never do interval arithmetic on elapsed times , its not a problem if you are aware that there are "infinite" ways to represent an epoch in an interval . Francisco Olarte.

Re: How to represent a bi-directional list in db?

2019-09-22 Thread Francisco Olarte
populate prev_stage_id, and index it and you can query next stage of a tuple using it. Francisco Olarte.

Re: How to represent a bi-directional list in db?

2019-09-23 Thread Francisco Olarte
ge stage lists, splicing things around ), I've normally found it's easier, in sql, to model this kind of thing with a master-detail + order column. ( whatever = (id, , first_stage_id), stages=(id, order, ) ) Francisco Olarte.

Re: How to represent a bi-directional list in db?

2019-09-24 Thread Francisco Olarte
ral data structures, SQL is declarative, so they are not a great match, that's one of the reasons why they are rarely seen. Things like master-detail have less impedance mismatch. Francisco Olarte.

Re: SELECT d02name::bytea FROM ... && DBI::Pg

2019-10-10 Thread Francisco Olarte
1234ABCD"),"\n")' 3132333441424344 $ perl -e 'print(unpack("H*", "día año"),"\n")' 64c3ad612061c3b16f Francisco Olarte.

Re: SELECT d02name::bytea FROM ... && DBI::Pg

2019-10-12 Thread Francisco Olarte
sing huge texts and extracting some data in C. But utf-8/latin-1, you're right, you have umlauts, we have accendts and n-tildes, I've been there and will be again. Enough off-topic anyway. Francisco Olarte.

Re: Is there any configuration in postgresql.conf or any other configuration of postgres which will make this possible to listen on particular interface

2019-10-16 Thread Francisco Olarte
-SETTINGS , although being lazy I just searched for "listen" on the manual index ) Francisco Olarte.

Re: CPU SPIKE

2019-10-21 Thread Francisco Olarte
-- > 22GB ... > max_worker_processes > -- > 8 I may be mislead, but isn't 16Gb a little spartan for 24 CPU with 8 workers ( per query ? ). Also, I assume the 22Gb is because you are accounting for a huge host cache. Francisco Olarte.

Re: Upgrade procedure

2019-10-30 Thread Francisco Olarte
names aka dir contents (not being able to do this is one of my strongest dislikes of windows, it makes so many things so much simpler ). Francisco Olarte.

Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)

2019-11-01 Thread Francisco Olarte
er of these are C, they COULD be C++ > // Begin the cursor Same as this comment. > PQexec(connection, ,"BEGIN")) > PQexec(connection, ,"myFetchSql”) And these are definitely not C ( no ; ) and, if you generated them by editing, myfetchsql is quoted which

Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)

2019-11-03 Thread Francisco Olarte
/logs of the postgres installed machine. ... Some more things followed by a huge bottom quote-to-the-sig. Your writing style makes it really hard to decipher what you are trying to say. I hope your problem has been solved, because I am not going to try to decipher it or comment more. Francisco Olarte.

Re:

2019-11-21 Thread Francisco Olarte
SERVER user ( as psql is separated, it communicates by a socket, can be in another machine ). Francisco Olarte.

Re: System column xmin makes anonymity hard

2020-05-12 Thread Francisco Olarte
move data around, in single transactions so you do not lose anything, like shaking a ballot box periodically ( but ensure the lid is properly taped first ). Francisco Olarte.

Re: Catching errors with Perl DBI

2020-07-02 Thread Francisco Olarte
set it to true in the handle, put all your code in a sub() and catch it, in programs where you donot have easy recovery of errors, and use local eval if needed to catch this kind of prim. key violation things. Francisco Olarte.

Re: Apply LIMIT when computation is logically irrelevant

2020-07-06 Thread Francisco Olarte
lass); to get a direct boolean and benefit from shortcircuiting, by putting the most likely one first, and from the internal knowledge the optimizer may have to not fully evaluate queries, which may be greater than deducting from the union/limit case. Francisco Olarte.

Re: Doubt in mvcc

2020-07-13 Thread Francisco Olarte
Other transactions may read them, which is why readers do not block writers, but two updates on the same tuple serialize. Francisco Olarte.

Re: Doubt in mvcc

2020-07-13 Thread Francisco Olarte
ere. But there are tons of info floating around, more or less easy to find. > Serialize is the solution to this issue. That's what locks and isolation levels do. Francisco Olarte.

Re: Improvement for query planner? (no, not about count(*) again ;-))

2020-07-20 Thread Francisco Olarte
ill try just select name1 from games to see how it goes. The PK stuff is bulk-loading 101. Try explain AND explain analyze of some variants, remember to analyze your tables ( seems redundant, but the PK & redundant hash key stuff leads me to think you are not too experienced on postgres usage ). Francisco Olarte.

Re: Bytea Example

2020-08-16 Thread Francisco Olarte
r LOBs, but if you do there are links which can be provided. Bear in mind that for all we know you could be connecting using your own gopher based tool which translates coloquial swahili to sql. Francisco Olarte.

Re: Reconstructing transaction content after the fact

2020-09-02 Thread Francisco Olarte
apps a single point of access to the DB mediating every query/operation with a stored procedure/function, using accounts with access to only those, even for selects, so you have tight control and easier auditing. Francisco Olarte.

Re: Network performance optimization

2020-09-09 Thread Francisco Olarte
re 5500 km over the great circle. Francisco Olarte.

Re: How to write such a query

2020-09-19 Thread Francisco Olarte
o it. When Access does it the database is in postgres, or swl server, or jet, or whatever. Access is not a database, in the sense postgres it. Jet is. Francisco Olarte.

Re: How to migrate column type from uuid to serial

2020-10-07 Thread Francisco Olarte
ses unicode codepoints instead of ASCII chars as units you could probably use more creative encodings ;-) , but probably using a "drop the dashes" subst in the interface will be your simpler option. Francisco Olarte.

Re: How to migrate column type from uuid to serial

2020-10-08 Thread Francisco Olarte
denser index than 16 byte uuid. Francisco Olarte.

Re: Strange behavior

2020-10-10 Thread Francisco Olarte
st1 as t1 wher t1.v1 not in ( select t2.v1 from test2 as t2 ) Would have caught it. Francisco Olarte.

Re: Another user error?

2020-11-01 Thread Francisco Olarte
ding one BEFORE the semicolon. If it matches something above you've got it. But really, show your code, otherwise you are not going to get much help. Francisco Olarte.

Re: Another user error?

2020-11-01 Thread Francisco Olarte
Rich: On Sun, Nov 1, 2020 at 8:04 PM Rich Shepard wrote: > > On Sun, 1 Nov 2020, Francisco Olarte wrote: > > > This is nearly impossible to diagnose without a chunk of the query ( > > i,e, the first lines and the last ones ). > Francisco, > $ psql -d bustrac -f loc

Re: Increased size of database dump even though LESS consumed storage

2021-02-10 Thread Francisco Olarte
use for partitioning. IIRC cluster will do the trick if it is indexed. ( This has happened to me compressing document dumps, presorting by some chosen fields improved my compression ratio a bit, IIRC it was due to the compressor searching for duplicates on a limited window only, this is why I use "detectable" redundancy ) Francisco Olarte.

Re: Increased size of database dump even though LESS consumed storage

2021-02-10 Thread Francisco Olarte
Thorsten: On Wed, Feb 10, 2021 at 12:36 PM Thorsten Schöning wrote: > Guten Tag Francisco Olarte, > am Mittwoch, 10. Februar 2021 um 10:38 schrieben Sie: > > [...]and partitioning sorts partially > > by date ( or fully if you have made the partitions by range-querying

Re: Increased size of database dump even though LESS consumed storage

2021-02-10 Thread Francisco Olarte
s may be chosen or not for queries. You should be the one more probable to know it. Francisco Olarte.

Re: getting tables list of other schema too

2021-02-24 Thread Francisco Olarte
, only user-created objects are shown; supply a pattern or the S modifier to include system objects.", but these sys schema does not seem to be a system one. Francisco Olarte.

Re: getting tables list of other schema too

2021-02-24 Thread Francisco Olarte
On Wed, Feb 24, 2021 at 12:12 PM Francisco Olarte wrote: > AFAIK dt list "tables", not "tables in the schemas in search path". > It states " By default, only user-created objects are shown; supply a > pattern or the S modifier to include system objects.",

Re: getting tables list of other schema too

2021-02-25 Thread Francisco Olarte
les, which are always there after DB creation and are normally needed for the server to work ) OBJECTS. Also, naming an schema "sys" does not make it a system schema. Francisco Olarte

Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines

2022-03-13 Thread Francisco Olarte
otes. For example: "aaa","b CRLF bb","ccc" CRLF zzz,yyy,xxx <<< Which somehow contradicts 2.1. In C/C++ it's easily parsed with a simple state machine reading char by char, wich is one of the strong points of those languages, but reading lines as strings usually leads to complex logic. Francisco Olarte.

Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines

2022-03-13 Thread Francisco Olarte
bs terminate with newlines" leads to uglier/harder to read lines but can express them). Francisco Olarte.

Re: Fresh eyeballs needed: input into error [FIXED]

2022-04-27 Thread Francisco Olarte
ackets ) where intercepted by its REPL leading to bizarre errors. And sometimes after a relogin things are done a bit different and make problem disappear. Francisco Olarte.

Re: External psql editor

2022-04-29 Thread Francisco Olarte
e readline wizardry. I've read joe has slave shell sessions. Other thing you could try ( I've done it with emacs shell mode ) is use that, but I fear it only works well with single line queries. Or look if it has some kind of sql modes ( interactive sql, not sql-script-syntax-highlight ). Francisco Olarte.

Re: Backing up a DB excluding certain tables

2022-05-04 Thread Francisco Olarte
nt versions ( you gave it a switch, it wrote a commented list of IDs which you could edit ( normally avoiding reorders ) and feed back with another switch to make partial backups, it was really useful for selective backups of complex stuff ). Francisco Olarte.

Re: Backing up a DB excluding certain tables

2022-05-04 Thread Francisco Olarte
Replying to self... On Wed, 4 May 2022 at 19:19, Francisco Olarte wrote: > An I remember pg_dump had a catalog mode, but it seems to have > dissapeared in recent versions ( you gave it a switch, it wrote a > commented list > of IDs which you could edit ( normally avoiding reorder

Re: Psycopg3 fails to resolve 'timezone localtime' on MacOS

2022-05-06 Thread Francisco Olarte
Jerry: On Fri, 6 May 2022 at 03:04, Jerry Sievers wrote: > Has anyone run into This? > Psycopg3 fails to resolve timezone localtime on MacOS (Catalina). > > It falls back to UTC regardless of whether running with/without the > tzdata package which I did try. > > There is a /etc/localtime symlink

Re: generated column cast from timestamptz to timestamp not OK.

2022-05-13 Thread Francisco Olarte
On Fri, 13 May 2022 at 12:47, alias wrote: > CREATE TABLE test_g ( > a timestamptz, > b timestamp GENERATED ALWAYS AS (a::timestamp) STORED > ); > then an error occurred. >> ERROR: 42P17: generation expression is not immutable Cast to timestamp uses current session time zone, current ses

Re: How to get response message

2022-06-10 Thread Francisco Olarte
On Fri, 10 Jun 2022 at 18:38, Rama Krishnan wrote: > > Hi All, > > I am want to delete old records using function so my senior has function like > below but I want to get response of this particular inside query wheter it is > successful or failure > How to get response of the function status

Re: ADD COLUMN ts tsvector GENERATED too slow

2022-07-06 Thread Francisco Olarte
e kind of query, hi cpu would depend on what you call it, but it wouldn't surprise me if it has at least one cpu running at full detoasting and doing vectors, I do not know if alter table can go paralell.. Francisco Olarte.

Re: ADD COLUMN ts tsvector GENERATED too slow

2022-07-06 Thread Francisco Olarte
Hi Florents: On Wed, 6 Jul 2022 at 12:35, Florents Tselai wrote: > 50M+ rows and iirc pg_relation_size was north of 80GB or so. Somebody already mentioned pg_table_size, but anyway this gives you 1.6Kb per row, which I would suspect is extremely low given your pdf content and the 1M truncation y

Re: postgresql generate ddl returns FK with `()` in it

2022-07-08 Thread Francisco Olarte
n. Post more details and someone may be able to help you. Regards. Francisco Olarte.

Re: Error when pasting function blocks into psql

2022-07-08 Thread Francisco Olarte
you can see if your IDE/EDITOR/putty is plain nasty tricks ( if you tried pasting into cat you can cat that file and the one from vim ). Francisco Olarte.

Re: - operator overloading not giving expected result

2022-07-08 Thread Francisco Olarte
, but rather you inserting dates in timestamp columns and then substracting said columns? Because even your operations are defined in terms of timestamptz, not dates. Francisco Olarte.

Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence

2022-07-19 Thread Francisco Olarte
able now for simplicity, I doubt I gained enough performance to justify the 20-something perl lines plus the crontab entry to use sequences. As beard turns grey I apreciate more the simpler ways to do things. Francisco Olarte.

Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence

2022-07-20 Thread Francisco Olarte
Hi Gavan. On Wed, 20 Jul 2022 at 00:10, Gavan Schneider wrote: > On 20 Jul 2022, at 4:08, Francisco Olarte wrote: > As a remark, in Spain bill numbers need to be gapless increasing. I > have done it with > > One answer to this problem has been around for a while, and my vers

Re: How does postgres sort large strings?

2022-07-22 Thread Francisco Olarte
at a time will end on the 501 char. And probably PG can compare the strings in the shared buffers, so it only needs some housekeeping information in work mem, and rely on its infrastructure to bring the contents into shared buffers. I do not think you are estimating memory usage right. Francis

Re: Password reset link / 'less' does not exit in psql version 13.4

2022-07-25 Thread Francisco Olarte
Michael: On Mon, 25 Jul 2022 at 12:01, Michael J. Baars wrote: > 2) I have three psql clients running, a version 12.6, a version 13.4 and a > version 14.3. Until now a 'select * from table;' showed the output in 'less' > or something alike and exited from 'less' when > the output was complete.

Re: Purpose of DEFERRABLE _and_ INITIALLY DEFERRED foreign key constraint checking?

2022-08-04 Thread Francisco Olarte
Ron: On Thu, 4 Aug 2022 at 02:30, Ron wrote: > DEFERRABLE > NOT DEFERRABLE > This controls whether the constraint can be deferred. A constraint that is > not deferrable will be checked immediately after every command. Checking of > constraints that are deferrable can be postponed until the end

Re: Behavior of identity columns

2022-08-04 Thread Francisco Olarte
ing row, when it fails it is gone. Search lists, google, the docs, its been explained ad nauseam. Francisco Olarte.

Re: Creating constraint dynamically

2022-08-22 Thread Francisco Olarte
you can recover a condition set on a column. It is transformed to an equivalent. I'm not sure how it is exactly done, but it probably also does whitespace normalization and constant folding. Francisco Olarte.

Re: Resolving host to IP address

2022-09-12 Thread Francisco Olarte
Also, if you want it to work you would need a second hostssl line listing localhost as the source address, or, IIRC, you can try to force the source address for connections to be toro using some deep magic jujus, as psql does not seem to suipport setting it. Francisco Olarte.

Re: Resolving host to IP address

2022-09-12 Thread Francisco Olarte
", which gives the selected one: $ ip route get 127.1.2.3 local 127.1.2.3 dev lo src 127.0.0.1 uid 1000 cache Francisco Olarte.

Re: Resolving host to IP address

2022-09-12 Thread Francisco Olarte
t existed ). Note: localhost is a name, like toro, and is resolved, samehost/samenet/all are magic. Sumarizing, I would: - Use listen_adresses=* - Use samehost in your rules. Which will lead to a lean config which probably does what you want. Francisco Olarte.

Re: Using CTID system column as a "temporary" primary key

2023-03-29 Thread Francisco Olarte
ike a misfeature, like needing DUAL to be more oracle-compatible. Francisco Olarte.

Re: Do BRIN indexes support MIN/MAX?

2023-03-29 Thread Francisco Olarte
x read drops to about 10Mb, plus the 1Mb range. Also, I suspect you will have to read all unsummarized ranges ( probably before the summarized ones, as unsummarized can discard summarizeds, but not the other way ). Francisco Olarte.

Re: Using CTID system column as a "temporary" primary key

2023-03-30 Thread Francisco Olarte
ollow standards, and do something reasonable when not possible, but this informix wart sounds particularly worthless to implement. Beside your use case I do not think it would serve for anything else than encouraging people to use an ill dessigned informix feature. Francisco Olarte.

  1   2   3   >