Hot answers tagged

4

In the ANSI SQL Standard, there is no TEXT type. There are various string types defined, like CHAR and VARCHAR and many more but no mention of a TEXT type. There is a CHARACTER LARGE OBJECT and a BINARY LARGE OBJECT. The various TEXT types found in various DBMS (Postgres, SQL Server, MySQL) are additions and have small differences between them. Their ...


2

The psql command \? shows the option to turn off expanded formatting: Formatting: ... \x [on|off|auto] toggle expanded output (currently off) Typically it will show table data in one record per line if its "off" or else each field in its own line when switched on, e.g.: postgres=# \x off Expanded display is off. postgres=# \l ...


2

A method that I find useful is to implement the cleanup code in my main programming framework (so Django, I guess, in your case) and expose that function via a URL. Then in my crontab I use wget or curl to invoke the cleanup URL. That way the cron file is only responsible for the scheduling part, while the code that does the cleanup is kept together with ...


2

You can generate the SQL to add the primary key with: select concat('ALTER TABLE ',table_schema,'.',table_name,' ADD CONSTRAINT ', table_schema,'.pk_',table_name,' PRIMARY KEY (id)') from information_schema.columns where column_name ='id' and table_schema='xxx'; Replace the xxx with the schema for which you want to create the primary ...


1

If you migrate from RDBMS to NoSQL then you will also have problems. They are not interchangeable for all types of usage. When you start a project then just before you start the creation of your data objects you must choose the one that suits best to your needs. Changing later will nearly always cause problems as soon as you use more then the 'standard' ...


1

This might be too broad of a question but as with any system, the less steps and dependencies you have, the easier it is to support it as long as it meets current and future (or future enough) business goals. In your use case scenario it doesn't look like you have any use for HDFS and SQOOP. In a lot of environments they might. For example they might ...


1

If You are querying just one table (like SELECT * FROM table) then right click on it in Object browser, choose View Data from context menu, You will have options to View Top 100 Rows or View Last 100 Rows. Other than that, use LIMIT and OFFSET clauses in Your queries: https://www.postgresql.org/docs/9.3/static/queries-limit.html


1

Using pgAdmin III, I ran the following command to generate 100,000 random records. create table t_random as select s, md5(random()::text) from generate_Series(1, 100000) s; I then did as MarcinS suggested in his answer: "right click on it in Object browser, choose View Data from context menu, You will have options to View Top 100 Rows or View Last 100 ...



Only top voted, non community-wiki answers of a minimum length are eligible